File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 3434
3535 push-to-ghcr :
3636 runs-on : ubuntu-latest
37- if : github.ref == 'refs/heads/main'
37+ # if: github.ref == 'refs/heads/main'
3838 needs : build-test
3939 permissions :
4040 contents : read
6363 run : |
6464 echo "LOWERCASE_REPO=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
6565
66+ - name : Set IMAGE_TAG for build-test
67+ run : |
68+ if [ "${{ github.event_name }}" = "pull_request" ]; then
69+ echo "IMAGE_TAG=test" >> $GITHUB_ENV
70+ elif [ "${{ github.ref }}" = "refs/heads/main" ]; then
71+ echo "IMAGE_TAG=latest" >> $GITHUB_ENV
72+ else
73+ echo "IMAGE_TAG=${GITHUB_SHA::8}" >> $GITHUB_ENV
74+ fi
75+
6676 - name : Extract metadata for Docker
6777 id : meta
6878 uses : docker/metadata-action@v5
7787 file : ./docker/Dockerfile
7888 push : true
7989 tags : |
80- ghcr.io/${{ env.LOWERCASE_REPO }}:latest
90+ ghcr.io/${{ env.LOWERCASE_REPO }}:${{ env.IMAGE_TAG }}
8191 ghcr.io/${{ env.LOWERCASE_REPO }}:${{ github.sha }}
8292 labels : ${{ steps.meta.outputs.labels }}
You can’t perform that action at this time.
0 commit comments