Skip to content

Commit

Permalink
Update image-build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
georgepstaylor committed Sep 20, 2024
1 parent 7cf703a commit 700b365
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ jobs:
echo "SAFE_TAG=$(echo ${{ github.ref_name }} | sed 's/[^a-zA-Z0-9.]/-/g')" >> $GITHUB_OUTPUT
fi
- name: Output VERSION_REF
id: output_version_ref
run: |
if "${{ github.event_name }}" == "pull_request"; then
# if on a PR we need to get the current branch name
echo "VERSION_REF=$(echo ${{ github.event.pull_request.head.ref }}" >> $GITHUB_OUTPUT
else
echo "VERSION_REF=$(echo ${{ github.ref_name }}" >> $GITHUB_OUTPUT
fi
- name: Set up Docker Buildx
id: setup_buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -55,7 +65,7 @@ jobs:
push: true
tags: ghcr.io/ministryofjustice/hmpps-ldap-automation:${{ steps.safe_tag.outputs.SAFE_TAG }}
build-args: |
VERSION_REF=${{ steps.BumpVersionAndPushTag.outputs.new_tag }}
VERSION_REF=${{ steps.output_version_ref.outputs.VERSION_REF }}
- name: Comment image tag on PR
if: github.event_name == 'pull_request'
Expand Down

0 comments on commit 700b365

Please sign in to comment.