diff --git a/.github/workflows/alpine-mainline.yml b/.github/workflows/alpine-mainline.yml index ca5ed32..3a788c5 100644 --- a/.github/workflows/alpine-mainline.yml +++ b/.github/workflows/alpine-mainline.yml @@ -112,10 +112,19 @@ jobs: context: "{{ defaultContext }}:mainline/alpine-slim" tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - push: ${{ github.event_name != 'pull_request' }} + # push: ${{ github.event_name != 'pull_request' }} + outputs: ${{ github.event_name != 'pull_request' && 'type=registry' || 'type=oci,dest=/tmp/nginxslim.tar' }} # cache-from: type=gha,scope=alpine-slim # cache-to: type=gha,mode=min,scope=alpine-slim + - name: Upload Docker build artifact during local builds + if: ${{ github.event_name == 'pull_request' }} + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + with: + name: nginxslim + path: /tmp/nginxslim.tar + retention-days: 1 + - name: Sign Docker Hub Manifest if: ${{ github.event_name != 'pull_request' }} run: | @@ -198,6 +207,18 @@ jobs: username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_TOKEN }} + - name: Download artifact + if: ${{ github.event_name == 'pull_request' }} + uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2 + with: + name: nginxslim + path: /tmp + + - name: Load image + if: ${{ github.event_name == 'pull_request' }} + run: | + docker load --input /tmp/nginxslim.tar + - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 @@ -227,10 +248,19 @@ jobs: context: "{{ defaultContext }}:mainline/alpine" tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - push: ${{ github.event_name != 'pull_request' }} + # push: ${{ github.event_name != 'pull_request' }} + outputs: ${{ github.event_name != 'pull_request' && 'type=registry' || 'type=oci,dest=/tmp/nginxcore.tar' }} # cache-from: type=gha,scope=debian-perl # cache-to: type=gha,mode=min,scope=debian-perl + - name: Upload Docker build artifact during local builds + if: ${{ github.event_name == 'pull_request' }} + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + with: + name: nginxcore + path: /tmp/nginxcore.tar + retention-days: 1 + - name: Sign Docker Hub Manifest if: ${{ github.event_name != 'pull_request' }} run: | @@ -334,6 +364,18 @@ jobs: type=raw,value=alpine-perl type=raw,value=alpine${{ needs.version.outputs.distro }}-perl + - name: Download artifact + if: ${{ github.event_name == 'pull_request' }} + uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2 + with: + name: nginxcore + path: /tmp + + - name: Load image + if: ${{ github.event_name == 'pull_request' }} + run: | + docker load --input /tmp/nginxcore.tar + - name: Build and push NGINX mainline perl Alpine image to Amazon ECR Public Gallery, Docker Hub, GitHub Container Registry, and Quay id: build uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0 @@ -343,6 +385,7 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} push: ${{ github.event_name != 'pull_request' }} + # outputs: ${{ github.event_name != 'pull_request' && 'type=registry' || 'type=oci,dest=/tmp/nginxslim.tar' }} # cache-from: type=gha,scope=alpine-perl # cache-to: type=gha,mode=min,scope=alpine-perl