Skip to content

Commit

Permalink
Merge pull request #241 from GeoscienceAustralia/fix_action_typo
Browse files Browse the repository at this point in the history
fix the empty tag
  • Loading branch information
benjimin authored Jan 13, 2023
2 parents b3aa96f + ca8711c commit 5b3934a
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/sandbox-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,22 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Get image tag
id: tag-image
run: |
# check if the tag string is empty
# tag = `dev_tag` if triggered by pr merged
# or `release_tag` if triggered by release published
# or `dev_tag,release_tag`, which should not happen given current workflow though
if [[ ! -z "${{ needs.set_dev_tags.outputs.image_tag }}" ]]; then \
tag="${{ needs.set_dev_tags.outputs.image_tag }}"; fi
if [[ ! -z "${{ needs.set_release_tags.outputs.image_tag }}" ]]; then \
if [[ ! -z $tag ]]; then \
tag=$tag",${{ needs.set_release_tags.outputs.image_tag }}"; else \
tag="${{ needs.set_release_tags.outputs.image_tag }}"; fi \
fi
echo "TAG=$tag" >> $GITHUB_OUTPUT
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
Expand All @@ -68,4 +84,4 @@ jobs:
context: ./docker
registry: 538673716275.dkr.ecr.ap-southeast-2.amazonaws.com
image_name: ${{ env.IMAGE_NAME }}
image_tag: latest,${{ needs.set_dev_tags.outputs.image_tag }},${{ needs.set_release_tags.outputs.image_tag }}
image_tag: latest,${{ steps.tag-image.outputs.TAG }}

0 comments on commit 5b3934a

Please sign in to comment.