diff --git a/.github/workflows/build-debian-images.yaml b/.github/workflows/build-debian-images.yaml index abf62fe..a1a4713 100644 --- a/.github/workflows/build-debian-images.yaml +++ b/.github/workflows/build-debian-images.yaml @@ -3,6 +3,7 @@ name: Build Debian images for PDNS CI on: workflow_dispatch: push: + pull_request: schedule: - cron: '0 23 * * *' @@ -25,13 +26,17 @@ jobs: steps: - uses: actions/checkout@v3 + - run: | + echo "image-id-lowercase=ghcr.io/${{ github.repository }}/${{ matrix.image-id }}" | tr '[:upper:]' '[:lower:]' >> "$GITHUB_ENV" + - name: Build image run: | docker build . --file Dockerfile \ - --tag ghcr.io/${{ github.repository }}/${{ matrix.image-id }}:${{ env.IMAGE_TAG }} \ + --tag ${{ env.image-id-lowercase }}:${{ env.IMAGE_TAG }} \ --build-arg DEBIAN_IMAGE_TAG=${{ matrix.debian-release-name }} - name: Login to GitHub Container Registry + if: ${{ github.event_name != 'pull_request' }} uses: docker/login-action@v2 with: registry: ghcr.io @@ -39,5 +44,6 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Push into Github Container Registry + if: ${{ github.event_name != 'pull_request' }} run: | - docker push ghcr.io/${{ github.repository }}/${{ matrix.image-id }}:${{ env.IMAGE_TAG }} + docker push ${{ env.image-id-lowercase }}:${{ env.IMAGE_TAG }}