diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index bf33cd4a..736c5ebc 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -4,9 +4,9 @@ on: schedule: - cron: '23 20 * * 0' workflow_dispatch: - push: + pull_request: branches: - - 'build/**' + - '5.x' pull_request_target: types: - closed @@ -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 || contains(fromJson('["schedule", "workflow_dispatch"]'), github.event_name) || github.event_name == 'pull_request' && startsWith(github.head_ref,'build/') 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