From eb25b73b19240ffdba46407f13bdd289ab664e19 Mon Sep 17 00:00:00 2001 From: 0fatal <72899968+0fatal@users.noreply.github.com> Date: Tue, 19 Dec 2023 14:35:41 +0800 Subject: [PATCH] chore(ci): add digest for images of the pr (#1736) --- .../workflows/dockerize-runtime-exporter.yml | 6 +++-- .../workflows/dockerize-runtime-nodejs.yml | 10 ++++----- .github/workflows/dockerize-server.yml | 22 ++++++++++--------- .github/workflows/dockerize-web.yml | 22 ++++++++++--------- 4 files changed, 33 insertions(+), 27 deletions(-) diff --git a/.github/workflows/dockerize-runtime-exporter.yml b/.github/workflows/dockerize-runtime-exporter.yml index 4f9a8d3f1b..019bf19806 100644 --- a/.github/workflows/dockerize-runtime-exporter.yml +++ b/.github/workflows/dockerize-runtime-exporter.yml @@ -22,7 +22,7 @@ on: # pull-requests: write # packages: write # contents: read - + concurrency: group: dockerize-runtime-exporter-${{ github.ref }} cancel-in-progress: true @@ -72,6 +72,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push + id: docker-build uses: docker/build-push-action@v3 with: context: ./services/runtime-exporter @@ -85,12 +86,13 @@ jobs: if: github.event_name == 'pull_request_target' uses: mshick/add-pr-comment@v2 with: - message-id: 'dockerize-runtime-exporter' + message-id: "dockerize-runtime-exporter" message: | **:boom: laf runtime exporter image built successfully for pr ${{ github.event.pull_request.number }}** ``` ${{ steps.meta.outputs.tags }} ``` + digest: `${{ steps.docker-build.outputs.digest }}` trigger-workflow-build-cluster-image: needs: [dockerize-runtime-exporter] diff --git a/.github/workflows/dockerize-runtime-nodejs.yml b/.github/workflows/dockerize-runtime-nodejs.yml index 969d4a13be..4ebcec6c82 100644 --- a/.github/workflows/dockerize-runtime-nodejs.yml +++ b/.github/workflows/dockerize-runtime-nodejs.yml @@ -24,7 +24,7 @@ on: # pull-requests: write # packages: write # contents: read - + concurrency: group: dockerize-runtime-nodejs-${{ github.ref }} cancel-in-progress: true @@ -88,6 +88,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push + id: docker-build uses: docker/build-push-action@v3 with: context: ./runtimes/nodejs @@ -101,12 +102,13 @@ jobs: if: github.event_name == 'pull_request_target' uses: mshick/add-pr-comment@v2 with: - message-id: 'dockerize-runtime-nodejs' + message-id: "dockerize-runtime-nodejs" message: | **:boom: laf nodejs runtime image built successfully for pr ${{ github.event.pull_request.number }}** ``` ${{ steps.meta.outputs.tags }} ``` + digest: `${{ steps.docker-build.outputs.digest }}` dockerize-init-image: runs-on: ubuntu-latest @@ -165,15 +167,13 @@ jobs: if: github.event_name == 'pull_request_target' uses: mshick/add-pr-comment@v2 with: - message-id: 'dockerize-runtime-nodejs-init' + message-id: "dockerize-runtime-nodejs-init" message: | **:boom: laf nodejs runtime init image built successfully for pr ${{ github.event.pull_request.number }}** ``` ${{ steps.meta.outputs.tags }} ``` - - # trigger-workflow-e2e: # needs: [dockerize-main-image] # runs-on: ubuntu-latest diff --git a/.github/workflows/dockerize-server.yml b/.github/workflows/dockerize-server.yml index 0151587665..98d2c14efa 100644 --- a/.github/workflows/dockerize-server.yml +++ b/.github/workflows/dockerize-server.yml @@ -6,17 +6,17 @@ on: branches: [main] types: [opened, synchronize, reopened] paths: - - 'server/**' - - '.github/workflows/dockerize-server.yml' - - '!**/*.md' - - '!server/package-lock.json' + - "server/**" + - ".github/workflows/dockerize-server.yml" + - "!**/*.md" + - "!server/package-lock.json" push: branches: [main] paths: - - 'server/**' - - '.github/workflows/dockerize-server.yml' - - '!**/*.md' - - '!server/package-lock.json' + - "server/**" + - ".github/workflows/dockerize-server.yml" + - "!**/*.md" + - "!server/package-lock.json" # permissions: # pull-requests: write @@ -93,6 +93,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push + id: docker-build uses: docker/build-push-action@v3 with: context: ./server @@ -101,17 +102,18 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} platforms: linux/amd64, linux/arm64 - + - name: Comment docker image tags to PR if: github.event_name == 'pull_request_target' uses: mshick/add-pr-comment@v2 with: - message-id: 'dockerize-server' + message-id: "dockerize-server" message: | **:boom: laf server image built successfully for pr ${{ github.event.pull_request.number }}** ``` ${{ steps.meta.outputs.tags }} ``` + digest: `${{ steps.docker-build.outputs.digest }}` trigger-workflow-build-cluster-image: needs: [dockerize-server] diff --git a/.github/workflows/dockerize-web.yml b/.github/workflows/dockerize-web.yml index 88300104b8..03825ea412 100644 --- a/.github/workflows/dockerize-web.yml +++ b/.github/workflows/dockerize-web.yml @@ -6,18 +6,18 @@ on: branches: [main] types: [opened, synchronize, reopened] paths: - - 'web/**' - - '.github/workflows/dockerize-web.yml' - - '!**/*.md' - - '!web/package-lock.json' + - "web/**" + - ".github/workflows/dockerize-web.yml" + - "!**/*.md" + - "!web/package-lock.json" push: branches: - main paths: - - 'web/**' - - '.github/workflows/dockerize-web.yml' - - '!**/*.md' - - '!web/package-lock.json' + - "web/**" + - ".github/workflows/dockerize-web.yml" + - "!**/*.md" + - "!web/package-lock.json" # permissions: # pull-requests: write @@ -72,7 +72,7 @@ jobs: SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} with: sourcemaps: dist/assets - url_prefix: '~/assets/' + url_prefix: "~/assets/" version: ${{ format('laf@{0}', github.sha) }} working_directory: web ignore_missing: true @@ -114,6 +114,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push + id: docker-build uses: docker/build-push-action@v3 with: context: ./web @@ -127,12 +128,13 @@ jobs: if: github.event_name == 'pull_request_target' uses: mshick/add-pr-comment@v2 with: - message-id: 'dockerize-web' + message-id: "dockerize-web" message: | **:boom: laf web image built successfully for pr ${{ github.event.pull_request.number }}** ``` ${{ steps.meta.outputs.tags }} ``` + digest: `${{ steps.docker-build.outputs.digest }}` trigger-workflow-build-cluster-image: needs: [dockerize-web]