Skip to content

Commit

Permalink
try to create tag and image name once
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Pelletier committed Feb 1, 2024
1 parent eebf3c0 commit 84c7dc3
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/webhook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,20 @@ jobs:
packages: write # push docker images
steps:
- uses: actions/checkout@v4
- run: echo "VERSION=$(cat version.txt)" >> "$GITHUB_OUTPUT"
id: version-selector
- run: |
echo "VERSION=$(cat version.txt)" >> "$GITHUB_OUTPUT"
echo "TAG_NAME=${{ env.GIT_TAG_PREFIX }}${{ steps.naming-selector.outputs.VERSION }}" >> "$GITHUB_OUTPUT"
echo "IMAGE_NAME=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.naming-selector.outputs.VERSION }}" >> "$GITHUB_OUTPUT"
id: naming-selector
name: generate image name
- run: |
IMAGE_NAME=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version-selector.outputs.VERSION }}
! docker manifest inspect $IMAGE_NAME
! docker manifest inspect ${{ steps.naming-selector.outputs.IMAGE_NAME }}
name: confirm image is not already pushed
- run: |
TAG_NAME=${{ env.GIT_TAG_PREFIX }}${{ steps.version-selector.outputs.VERSION }}
git fetch --tags
! git rev-parse -q --verify "refs/tags/$TAG_NAME"
! git rev-parse -q --verify "refs/tags/${{ steps.naming-selector.outputs.TAG_NAME }}"
name: confirm git tag does not exist
- uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
Expand All @@ -83,12 +84,12 @@ jobs:
# with:
# context: ${{ env.WORKING_DIR }}
# push: true
# tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version-selector.outputs.VERSION }}
# tags: ${{ steps.naming-selector.outputs.IMAGE_NAME }}

- uses: mathieudutour/github-tag-action@v6.1
id: tag_version
with:
custom_tag: ${{ env.GIT_TAG_PREFIX }}${{ steps.version-selector.outputs.VERSION }}
custom_tag: ${{ steps.naming-selector.outputs.TAG_NAME }}
github_token: ${{ secrets.GITHUB_TOKEN }}

- uses: ncipollo/release-action@v1
Expand Down

0 comments on commit 84c7dc3

Please sign in to comment.