Skip to content

Commit

Permalink
Merge pull request #1182 from mattwoberts/main
Browse files Browse the repository at this point in the history
Update the Github action to push docker images on tag pushes
  • Loading branch information
mattwoberts authored Aug 24, 2024
2 parents 8b7a7d4 + d0ab7dc commit 0387364
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- main
tags:
- "v*" # Triggers on version tags like v1.0.0
pull_request:
branches:
- main
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 0387364

Please sign in to comment.