Skip to content

chore(deps): update dependency axios to v1.13.4 #3605

chore(deps): update dependency axios to v1.13.4

chore(deps): update dependency axios to v1.13.4 #3605

Workflow file for this run

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches: ['main']
pull_request:
branches: ['main']
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
env:
VITE_API_BASE_URL: '/devtable-api/'
VITE_WEBSITE_BASE_URL: '/devtable/website/'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
# Cache Nx
- name: Cache Nx
uses: actions/cache@v4
with:
path: .nx
key: ${{ runner.os }}-nx-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-nx-
- run: yarn install --frozen-lockfile
- uses: nrwl/nx-set-shas@v3
- run: yarn exec nx affected --target=check,test --configuration=ci
- run: yarn exec nx run-many -t build -p website api dashboard settings-form --parallel=3
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: |
website/dist
api/_build
dashboard/dist
settings-form/dist
publish_npm:
needs: build
runs-on: ubuntu-latest
permissions:
id-token: write # Required for OIDC
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'
# Ensure npm 11.5.1 or later is installed
- name: Update npm
run: npm install -g npm@latest
# Cache Nx
- name: Cache Nx
uses: actions/cache@v4
with:
path: node_modules/.cache/nx
key: ${{ runner.os }}-nx-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-nx-
- run: yarn install --frozen-lockfile
# Download build artifacts from build job
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: dist
# Check if dashboard version is already published
- name: Check dashboard version on npm
id: check_dashboard
continue-on-error: true
run: yarn exec nx run dashboard:is-published
# Check if settings-form version is already published
- name: Check settings-form version on npm
id: check_settings_form
continue-on-error: true
run: yarn exec nx run settings-form:is-published
# Publish dashboard to npm
- name: Publish dashboard to npm
if: steps.check_dashboard.outcome == 'success'
run: |
cd dashboard
VERSION=$(node -p "require('./package.json').version")
if [[ "$VERSION" == *"-"* ]]; then
TAG_FLAG="--tag next"
else
TAG_FLAG=""
fi
npm publish --provenance --access public $TAG_FLAG
# Publish settings-form to npm
- name: Publish settings-form to npm
if: steps.check_settings_form.outcome == 'success'
run: |
cd settings-form
VERSION=$(node -p "require('./package.json').version")
if [[ "$VERSION" == *"-"* ]]; then
TAG_FLAG="--tag next"
else
TAG_FLAG=""
fi
npm publish --provenance --access public $TAG_FLAG
build_images:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Cache Nx
uses: actions/cache@v4
with:
path: .nx
key: ${{ runner.os }}-nx-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-nx-
- run: yarn install --frozen-lockfile
- name: docker login
uses: docker/login-action@v2.1.0
with:
registry: registry.cn-hongkong.aliyuncs.com
username: devops@1148299792416188
password: ${{ secrets.REGISTRY_HONGKONG_SECRET }}
- name: Get version from api/package.json
id: get_version
run: |
VERSION=v$(node -p "require('./api/package.json').version")
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
echo "Using version: ${VERSION}"
- name: Check if API image version is already published
id: check_api
continue-on-error: true
run: yarn exec nx run api:is-docker-published-api
- name: Check if Website image version is already published
id: check_website
continue-on-error: true
run: yarn exec nx run api:is-docker-published-website
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: dist
- name: env
run: |
echo "VITE_API_BASE_URL=/devtable-api/" > website/.env
echo "VITE_WEBSITE_BASE_URL=/devtable/website/" >> website/.env
- name: Setup buildx
run: docker buildx create --use
# Build and push API image if version is new
- name: Build and push API image
if: steps.check_api.outcome == 'success'
run: |
docker buildx build --platform linux/amd64,linux/arm64 \
-f Dockerfile-api \
-t registry.cn-hongkong.aliyuncs.com/merico/table:${{ steps.get_version.outputs.VERSION }} \
-t registry.cn-hongkong.aliyuncs.com/merico/table:latest \
. --push
# Build and push Website image if version is new
- name: Build and push Website image
if: steps.check_website.outcome == 'success'
run: |
docker buildx build --platform linux/amd64,linux/arm64 \
-f Dockerfile-website \
-t registry.cn-hongkong.aliyuncs.com/merico/table-website:${{ steps.get_version.outputs.VERSION }} \
-t registry.cn-hongkong.aliyuncs.com/merico/table-website:latest \
. --push
- name: Trigger GitLab CI pipeline
# Only trigger if at least one image was newly published
if: steps.check_api.outcome == 'success' || steps.check_website.outcome == 'success'
uses: eic/trigger-gitlab-ci@v3
with:
token: ${{ secrets.GITLAB_TOKEN }}
project_id: ${{ secrets.GITLAB_PROJECT_ID }}
ref_name: main
url: ${{ secrets.GITLAB_URL }}