diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 954c9d9a6..dbb9647f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,6 +4,8 @@ on: push: branches: - main + tags: + - "v*" # Triggers on version tags like v1.0.0 pull_request: branches: - main diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4b973bb74..fece0538f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -45,8 +45,8 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max - - name: build and push docker image (push) - if: ${{ github.event.workflow_run.event == 'push' }} + - name: build and push docker image (push branch) + if: ${{ github.event.workflow_run.event == 'push' && !startsWith(github.ref, 'refs/tags/') }} uses: docker/build-push-action@v3 with: push: true @@ -56,3 +56,15 @@ jobs: tags: getfider/fider:SHA_${{ github.event.workflow_run.head_sha }},getfider/fider:main cache-from: type=gha cache-to: type=gha,mode=max + + - name: build and push docker image (push tag) + if: ${{ github.event.workflow_run.event == 'push' && startsWith(github.ref, 'refs/tags/') }} + uses: docker/build-push-action@v3 + with: + push: true + context: . + build-args: COMMITHASH=${{ github.event.workflow_run.head_sha }} + platforms: linux/amd64,linux/arm64/v8 + tags: getfider/fider:${{ github.ref_name }} + cache-from: type=gha + cache-to: type=gha,mode=max