diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index 5f717e3..ed255ca 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -19,7 +19,9 @@ jobs: id: build run: | COMMIT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7) - docker build --file Dockerfile --tag ${{ github.repository }}:latest --tag ${{ github.repository }}:${COMMIT_SHA} . + IMAGE_NAME="ghcr.io/${{ github.repository }}/security-gate" + docker build --file Dockerfile --tag ${IMAGE_NAME}:latest --tag ${IMAGE_NAME}:${COMMIT_SHA} . + echo "IMAGE_NAME=${IMAGE_NAME}" >> $GITHUB_ENV echo "COMMIT_SHA=${COMMIT_SHA}" >> $GITHUB_ENV - name: Log in to GitHub Container Registry @@ -31,5 +33,5 @@ jobs: - name: Push Docker image to GitHub Container Registry run: | - docker push ghcr.io/${{ github.repository }}/security-gate:latest - docker push ghcr.io/${{ github.repository }}/security-gate:${{ env.COMMIT_SHA }} \ No newline at end of file + docker push ${{ env.IMAGE_NAME }}:latest + docker push ${{ env.IMAGE_NAME }}:${{ env.COMMIT_SHA }}