From 9e2632356a8c9a29aa7b991987086951999d48b9 Mon Sep 17 00:00:00 2001 From: John Wang Date: Thu, 25 May 2023 19:41:33 +0800 Subject: [PATCH] feat: add branch tags rule --- .github/workflows/build-api-image.yml | 8 ++------ .github/workflows/build-web-image.yml | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-api-image.yml b/.github/workflows/build-api-image.yml index b5be9bed8e..e0320eca2c 100644 --- a/.github/workflows/build-api-image.yml +++ b/.github/workflows/build-api-image.yml @@ -14,11 +14,6 @@ jobs: runs-on: ubuntu-latest if: github.event.pull_request.draft == false steps: - - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" - uses: actions/checkout@v2 - with: - persist-credentials: false - - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -37,6 +32,7 @@ jobs: with: images: langgenius/dify-api tags: | + type=ref,event=branch type=semver,pattern={{major}}.{{minor}}.{{patch}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} @@ -44,7 +40,7 @@ jobs: - name: Build and push uses: docker/build-push-action@v4 with: - context: api + context: "{{defaultContext}}:api" platforms: linux/amd64 build-args: | COMMIT_SHA=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }} diff --git a/.github/workflows/build-web-image.yml b/.github/workflows/build-web-image.yml index f1fccaa1e7..2655182e8c 100644 --- a/.github/workflows/build-web-image.yml +++ b/.github/workflows/build-web-image.yml @@ -14,11 +14,6 @@ jobs: runs-on: ubuntu-latest if: github.event.pull_request.draft == false steps: - - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" - uses: actions/checkout@v2 - with: - persist-credentials: false - - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -37,6 +32,7 @@ jobs: with: images: langgenius/dify-web tags: | + type=ref,event=branch type=semver,pattern={{major}}.{{minor}}.{{patch}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} @@ -44,7 +40,7 @@ jobs: - name: Build and push uses: docker/build-push-action@v4 with: - context: api + context: "{{defaultContext}}:web" platforms: linux/amd64 build-args: | COMMIT_SHA=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}