Skip to content

Commit

Permalink
fix redundant image name (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
phyrog authored Mar 11, 2024
1 parent 2aff2ad commit 957e62d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,14 @@ jobs:
if: ${{ startsWith(github.ref, 'refs/heads/main') }}
run: |
echo TAG_NAME=latest >> $GITHUB_ENV
echo IMG_REPOSITORY_NAME=$( echo ${{ github.repository_owner }} | awk '{print tolower($0)}' ) >> $GITHUB_ENV
- name: Retrieve tag name (feat branch)
if: ${{ startsWith(github.ref, 'refs/heads/feat') }}
run: |
echo "TAG_NAME=latest-$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
echo IMG_REPOSITORY_NAME=$( echo ${{ github.repository_owner }} | awk '{print tolower($0)}' ) >> $GITHUB_ENV
- name: Retrieve tag name (tag)
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
echo TAG_NAME=$(echo $GITHUB_REF | sed -e "s|refs/tags/||") >> $GITHUB_ENV
echo IMG_REPOSITORY_NAME=$( echo ${{ github.repository_owner }} | awk '{print tolower($0)}' ) >> $GITHUB_ENV
- name: Build and push container image
if: ${{ inputs.push-image }}
id: build-image
Expand All @@ -67,10 +64,10 @@ jobs:
platforms: linux/amd64, linux/arm64
push: true
tags: |
ghcr.io/${{ env.IMG_REPOSITORY_NAME }}/${{ github.repository }}:${{ env.TAG_NAME }}
ghcr.io/${{ github.repository }}:${{ env.TAG_NAME }}
- id: setoutput
name: Set output parameters
run: |
echo "repository=ghcr.io/${{ env.IMG_REPOSITORY_NAME }}/${{ github.repository }}" >> $GITHUB_OUTPUT
echo "repository=ghcr.io/${{ github.repository }}" >> $GITHUB_OUTPUT
echo "tag=${{ env.TAG_NAME }}" >> $GITHUB_OUTPUT
echo "digest=${{ steps.build-image.outputs.digest }}" >> $GITHUB_OUTPUT

0 comments on commit 957e62d

Please sign in to comment.