From 6025aa4b382c81c63f230d0232bd9d951ee7e88d Mon Sep 17 00:00:00 2001 From: Leonard Jonathan Oh Date: Wed, 22 Nov 2023 22:58:24 +0000 Subject: [PATCH] Run build on PR but don't push --- .github/workflows/docker.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 840b1265b..65403182d 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -3,7 +3,10 @@ name: docker on: push: tags: - - 'v2.*' + - '**' + pull_request: + branches: + - master # This is needed to push to GitHub Container Registry. See https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry permissions: @@ -28,9 +31,11 @@ jobs: images: | djmaze/snappymail ghcr.io/${{ github.repository }} + # type=ref,event=pr generates tag(s) on PRs only. E.g. 'pr-123', 'pr-123-abc0123' # type=ref,event=branch generates tag(s) on branch only. E.g. 'master', 'master-abc0123' # type=ref,event=tag generates tag(s) on tags only. E.g. 'v0.0.0', 'v0.0.0-abc0123', and 'latest' tags: | + type=ref,event=pr type=ref,suffix=-{{sha}},event=pr type=ref,event=branch type=ref,event=tag @@ -101,7 +106,7 @@ jobs: # TODO: Add more arches? # platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x platforms: linux/386,linux/amd64 - push: true + push: startsWith(github.ref, 'refs/tags/') # Push only on tags tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=local,src=/tmp/.buildx-cache