Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the Github action to push docker images on tag pushes #1182

Merged
merged 1 commit into from
Aug 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading