diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index bf33cd4a..02d4199e 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -4,7 +4,7 @@ on: schedule: - cron: '23 20 * * 0' workflow_dispatch: - push: + pull_request: branches: - 'build/**' pull_request_target: @@ -15,7 +15,7 @@ env: REGISTRY: ghcr.io jobs: buildx: - if: github.event.pull_request.merged == true || (github.event_name == 'push' && startsWith(github.ref, 'refs/heads/build/')) || contains(fromJson('["schedule", "workflow_dispatch"]'), github.event_name) + if: github.event.pull_request.merged == true || (github.event_name == 'pull_request' && startsWith(github.ref, 'refs/heads/build/')) || contains(fromJson('["schedule", "workflow_dispatch"]'), github.event_name) runs-on: ubuntu-latest strategy: matrix: @@ -43,7 +43,9 @@ jobs: images: | ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.images }} tags: | + type=ref,event=pr type=ref,event=branch + type=raw,value={{github.event.pull_request.head.ref}},enable=${{ github.event.pull_request.merged == true }} labels: | maintainer=Digital Victoria repository=${{ github.repositoryUrl }} @@ -60,4 +62,5 @@ jobs: ./gh-actions-bake.hcl ${{ steps.meta.outputs.bake-file }} # Target the default group - probably unnecessary. + # Target the default group - branchobably unnecessary. targets: ${{ matrix.images }} \ No newline at end of file