diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c583fd7..385ee21 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,17 +28,19 @@ jobs: version=latest ;; esac - tags="groonga/groonga:${version}-${{ matrix.id }}" + tag="groonga/groonga:${version}-${{ matrix.id }}" + tags="${tag}" if [ ${{ matrix.id }} = "debian" -a "${version}" = "latest" ]; then tags="${tags},groonga/groonga:latest" fi need_push="no" - if [ "${GITHUB_EVENT_NAME}" = "push" ]; then + if [ "${GITHUB_EVENT_NAME}" = "push" ] && [ "${GITHUB_REPOSITORY}" = "groonga/docker" ]; then need_push="yes" fi echo "DISTRIBUTION=${distribution}" >> ${GITHUB_ENV} echo "CONTEXT=./${distribution}" >> ${GITHUB_ENV} + echo "TAG=${tag}" >> ${GITHUB_ENV} echo "TAGS=${tags}" >> ${GITHUB_ENV} echo "NEED_PUSH=${need_push}" >> ${GITHUB_ENV} - uses: actions/checkout@v4 @@ -56,9 +58,13 @@ jobs: # cache-to: type=gha,mode=max context: ${{ env.CONTEXT }} push: ${{ env.NEED_PUSH == 'yes' }} + load: ${{ env.NEED_PUSH != 'yes' }} tags: ${{ env.TAGS }} - name: Image info run: | echo "ref: ${{ github.ref }}" echo "tags: ${{ env.TAGS }}" echo "digest: ${{ steps.docker_build.outputs.digest }}" + - name: Test if groonga command is executable + run: | + docker container run --rm --entrypoint "groonga" "${TAG}" --version