chore: publish v10.27.0 #1716
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: | |
tags: v* | |
branches: ['main'] | |
pull_request: | |
branches: ['main'] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.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@v3 | |
with: | |
fetch-depth: 0 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'yarn' | |
- run: yarn install --frozen-lockfile | |
- uses: nrwl/nx-set-shas@v3 | |
- run: yarn exec nx affected --target=check --parallel=3 | |
- name: debug local cache | |
run: | | |
ls -al ./node_modules/.cache/nx | |
cat ./node_modules/.cache/nx/run.json | |
- run: yarn exec nx affected --target=test --parallel=3 --configuration=ci | |
- run: yarn exec nx run-many -t build -p website api --parallel=3 | |
- name: debug local cache | |
run: | | |
ls -al ./node_modules/.cache/nx | |
cat ./node_modules/.cache/nx/run.json | |
- name: Archive artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: | | |
website/dist | |
api/_build | |
# only runs on the main branch or tags | |
build_images: | |
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: commit push | |
run: | | |
docker info | |
pwd | |
ls | |
- 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: Extract branch name | |
shell: bash | |
run: echo "BRANCH=${GITHUB_REF_NAME/\//_}" >> $GITHUB_OUTPUT | |
id: extract_branch | |
- name: Get current date | |
id: date | |
run: echo "TODAY=$(date +'%y%m%d_%H%M')" >> $GITHUB_OUTPUT | |
- name: Get commit | |
id: commitid | |
run: echo "COMMIT_ID=${GITHUB_SHA:0:7}" >> $GITHUB_OUTPUT | |
- name: image tag | |
id: tag | |
run: | | |
# if triggered by tag, use tag as image tag | |
if [[ $GITHUB_REF == refs/tags/* ]]; then | |
echo "TAG=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT | |
else | |
echo "TAG=${{ steps.extract_branch.outputs.BRANCH }}_${{ steps.date.outputs.TODAY }}_${{ steps.commitid.outputs.COMMIT_ID }}" >> $GITHUB_OUTPUT | |
fi | |
- name: env | |
run: | | |
echo "VITE_API_BASE_URL=/devtable-api/" > website/.env | |
echo "VITE_WEBSITE_BASE_URL=/devtable/website/" >> website/.env | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
- name: Build table image | |
run: docker build -f Dockerfile-api -t registry.cn-hongkong.aliyuncs.com/merico/table:${{ steps.tag.outputs.TAG }} . | |
- name: Push table image | |
run: docker push registry.cn-hongkong.aliyuncs.com/merico/table:${{ steps.tag.outputs.TAG }} | |
- name: Build table website image | |
run: docker build -f Dockerfile-website -t registry.cn-hongkong.aliyuncs.com/merico/table-website:${{ steps.tag.outputs.TAG }} . | |
- name: Push table website image | |
run: docker push registry.cn-hongkong.aliyuncs.com/merico/table-website:${{ steps.tag.outputs.TAG }} | |
- name: Trigger GitLab CI pipeline | |
# only runs if the previous step was successful | |
if: success() | |
uses: eic/trigger-gitlab-ci@v2 | |
with: | |
token: ${{ secrets.GITLAB_TOKEN }} | |
project_id: ${{ secrets.GITLAB_PROJECT_ID }} | |
ref_name: main |