Only publish on master (#59)

This commit is contained in:
Jesse Bannon 2022-06-01 22:05:52 -07:00 committed by GitHub
parent 3143647b8d
commit e6876f25e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,10 +47,16 @@ jobs:
run: docker build --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" docker/ run: docker build --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" docker/
- name: Log in to registry - name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin run: |
if [[ ${{ github.ref }} == 'refs/head/master' ]]; then
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
else
echo "Skipped on PRs"
fi
- name: Push image - name: Push image
run: | run: |
if [[ ${{ github.ref }} == 'refs/head/master' ]]; then
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
# Change all uppercase to lowercase # Change all uppercase to lowercase
@ -65,3 +71,7 @@ jobs:
echo VERSION=$VERSION echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION docker push $IMAGE_ID:$VERSION
else
echo "Skipped on PRs"
fi