diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5a1f1e0..2342f77 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,11 +36,18 @@ jobs: if [ ${{ matrix.id }} = "debian" -a "${version}" = "latest" ]; then tags="${tags},groonga/groonga:latest" fi + + need_push="no" + if [ "${GITHUB_EVENT_NAME}" = "push" ]; then + need_push="yes" + fi echo "DISTRIBUTION=${distribution}" >> ${GITHUB_ENV} echo "CONTEXT=./${distribution}" >> ${GITHUB_ENV} echo "TAGS=${tags}" >> ${GITHUB_ENV} + echo "NEED_PUSH=${need_push}" >> ${GITHUB_ENV} - uses: actions/checkout@v4 - uses: docker/login-action@v3 + if: env.NEED_PUSH == 'yes' with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} @@ -52,7 +59,7 @@ jobs: # cache-from: type=gha # cache-to: type=gha,mode=max context: ${{ env.CONTEXT }} - push: true + push: ${{ env.NEED_PUSH == 'yes' }} tags: ${{ env.TAGS }} - name: Image info run: |