Skip to content

Commit

Permalink
fix: ensure dev branch publishes image
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-nfc committed Aug 10, 2024
1 parent 5d960c3 commit 72ff19f
Showing 1 changed file with 26 additions and 23 deletions.
49 changes: 26 additions & 23 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,11 @@ jobs:
docker-publish:
if: ${{ github.ref_type == 'tag' }}
if: ${{(
github.ref_type == 'tag'
||
github.ref_name == 'development'
)}}
needs:
- docker-build
- docker-scan-vulnerability
Expand All @@ -688,11 +692,32 @@ jobs:


- name: Tag Image with GIT Tag '${{ github.ref_name }}'
if: ${{ github.ref_type == 'tag' }}
run: |
docker buildx imagetools create ${{ inputs.DOCKER_BUILD_REGISTRY }}/${{ inputs.DOCKER_BUILD_IMAGE_NAME }}:${{ inputs.DOCKER_TAG_IMAGE_TAG_SOURCE }} \
--tag ${{ inputs.DOCKER_PUBLISH_REGISTRY }}/${{ inputs.DOCKER_PUBLISH_IMAGE_NAME }}:${{ github.ref_name }} \
- name: Tag Image with GIT 'latest'
if: ${{ inputs.DOCKER_TAG_IMAGE_TAG_LATEST }}
id: tag-image
shell: bash
run: |
TAG_NAME=dev;
if [ "${{ github.ref_name }}" == 'master' ]; then
TAG_NAME=latest;
fi
echo "[Debug] TAG_NAME=${TAG_NAME}";
echo "mutable_tag_name=${TAG_NAME}" > $GITHUB_OUTPUT
docker buildx imagetools create ${{ inputs.DOCKER_BUILD_REGISTRY }}/${{ inputs.DOCKER_BUILD_IMAGE_NAME }}:${{ inputs.DOCKER_TAG_IMAGE_TAG_SOURCE }} \
--tag ${{ inputs.DOCKER_PUBLISH_REGISTRY }}/${{ inputs.DOCKER_PUBLISH_IMAGE_NAME }}:${TAG_NAME};
- name: Tag Image with GIT commit '${{ inputs.DOCKER_TAG_IMAGE_TAG_SOURCE }}'
if: ${{ inputs.DOCKER_TAG_IMAGE_TAG_SHA }}
Expand Down Expand Up @@ -751,28 +776,6 @@ jobs:
path: ${{ steps.sbom-attest.outputs.bundle-path }}



- name: Tag Image with GIT 'latest'
if: ${{ inputs.DOCKER_TAG_IMAGE_TAG_LATEST }}
id: tag-image
shell: bash
run: |
TAG_NAME=dev;
if [ "${{ github.ref_name }}" == 'master' ]; then
TAG_NAME=latest;
fi
echo "[Debug] TAG_NAME=${TAG_NAME}";
echo "mutable_tag_name=${TAG_NAME}" > $GITHUB_OUTPUT
docker buildx imagetools create ${{ inputs.DOCKER_BUILD_REGISTRY }}/${{ inputs.DOCKER_BUILD_IMAGE_NAME }}:${{ inputs.DOCKER_TAG_IMAGE_TAG_SOURCE }} \
--tag ${{ inputs.DOCKER_PUBLISH_REGISTRY }}/${{ inputs.DOCKER_PUBLISH_IMAGE_NAME }}:${TAG_NAME};
- name: Append GH Release Body
if: ${{ github.ref_type == 'tag' }}
id: release
Expand Down

0 comments on commit 72ff19f

Please sign in to comment.