Skip to content

Commit

Permalink
fix(ci): tag images with full commit sha (#1954)
Browse files Browse the repository at this point in the history
## Summary
Adds an additional tag to docker images corresponding to the full commit
hash.

## Background
Manually running github actions to build a docker image was not setting
the full sha hash, which argocd uses to pull images. This should always
set at least the full hash to the merge commit of a PR.

## Changes
Updated the docker metadata step to include an additional tag

## Testing
Manually with PR commit and triggering GH action. 

## Changelogs
 "No updates required."
  • Loading branch information
aajimal authored Feb 6, 2025
1 parent 3736477 commit e17fe3d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/reusable-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ jobs:
tags: |
type=ref,event=pr
type=match,pattern=refs/tags/${{ inputs.binary-name }}-v(.*),group=1,enable=${{ startsWith(env.FULL_REF, 'refs/tags/') }},value=${{ env.FULL_REF }}
type=sha
type=sha,format=short
type=sha,format=long
# set the actual commit SHA from the PR head instead of from the PR merge commit (alternatively, we could checkout the PR head in actions/checkout)
type=raw,value=sha-${{ github.event.pull_request.head.sha || github.sha }},enable=${{ startsWith(env.FULL_REF, 'refs/pull/') }}
# set latest tag for `main` branch
Expand Down

0 comments on commit e17fe3d

Please sign in to comment.