66 types : [opened, synchronize, reopened]
77 release :
88 types :
9- - created
9+ # "released" excludes pre-releases
10+ # "published" is either a release or a pre-release
11+ - published
1012 schedule :
1113 # Example of job definition:
1214 # .---------------- minute (0 - 59)
2729 - name : " Checkout source code at current commit"
2830 uses : actions/checkout@v2
2931 - name : Prepare tags for Docker image
30- if : (github.event_name == 'release' && github.event.action == 'created ') || github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
32+ if : (github.event_name == 'release' && github.event.action == 'published ') || github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
3133 id : prepare
3234 run : |
3335 COMMIT_SHA="${GITHUB_SHA}"
3739 VERSION=pr-${{ github.event.pull_request.number }}-merge
3840 COMMIT_SHA=${{ github.event.pull_request.head.sha }}
3941 fi
42+ printf "Version resolved to %s\n" "${VERSION}"
4043 TAGS=${{ github.repository }}:sha-${COMMIT_SHA:0:7}
4144 SLIM_TAGS=${{ github.repository }}:slim-sha-${COMMIT_SHA:0:7}
4245 if [[ -n $VERSION ]]; then
@@ -52,11 +55,13 @@ jobs:
5255 SLIM_TAGS="$SLIM_TAGS,${{ github.repository }}:slim-latest,${{ github.repository }}:slim-nightly"
5356 fi
5457 echo ::set-output name=tags::${TAGS}
58+ printf "TAGS are %s\n" "${TAGS}"
5559 echo ::set-output name=slim-tags::${SLIM_TAGS}
60+ printf "SLIM_TAGS are %s\n" "${SLIM_TAGS}"
5661 - name : Set up Docker Buildx
5762 uses : docker/setup-buildx-action@v1
5863 - name : Login to DockerHub
59- if : (github.event_name == 'release' && github.event.action == 'created ') || github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
64+ if : (github.event_name == 'release' && github.event.action == 'published ') || github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
6065 uses : docker/login-action@v1
6166 with :
6267 username : ${{ secrets.DOCKERHUB_USERNAME }}
@@ -65,12 +70,12 @@ jobs:
6570 id : docker_full_build
6671 uses : docker/build-push-action@v2
6772 with :
68- push : ${{ (github.event_name == 'release' && github.event.action == 'created ') || github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
73+ push : ${{ (github.event_name == 'release' && github.event.action == 'published ') || github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
6974 tags : ${{ steps.prepare.outputs.tags }}
7075 - name : " Build and push slim docker image to DockerHub"
7176 id : docker_slim_build
7277 uses : docker/build-push-action@v2
7378 with :
7479 file : ./Dockerfile.slim
75- push : ${{ (github.event_name == 'release' && github.event.action == 'created ') || github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
80+ push : ${{ (github.event_name == 'release' && github.event.action == 'published ') || github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
7681 tags : ${{ steps.prepare.outputs.slim-tags }}
0 commit comments