-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
try to create tag and image name once
- Loading branch information
Andrew Pelletier
committed
Feb 1, 2024
1 parent
eebf3c0
commit 84c7dc3
Showing
1 changed file
with
9 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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/[email protected] | ||
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 | ||
|