From 6ad19d877264662e0cab6b893252fb37a500f344 Mon Sep 17 00:00:00 2001 From: Guy Owen Date: Fri, 13 Oct 2023 15:18:02 +1100 Subject: [PATCH 1/5] [DDS-1723] Updated image tags. --- .github/workflows/build-deploy.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index bf33cd4a..05664b33 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -43,7 +43,8 @@ jobs: images: | ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.images }} tags: | - type=ref,event=branch + type=ref,event=pr + type=raw,value={{github.event.pull_request.head.ref}},enable=${{ github.event.pull_request.merged == true }} labels: | maintainer=Digital Victoria repository=${{ github.repositoryUrl }} From 5d957db5c7d835f38ef6a9d72d01cdc2611a2b78 Mon Sep 17 00:00:00 2001 From: Guy Owen Date: Fri, 13 Oct 2023 16:23:02 +1100 Subject: [PATCH 2/5] [DDS-1723] Updated workflow event trigger for PRs. --- .github/workflows/build-deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 05664b33..b4c28c1a 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: From 58095dbf2e42edc2d7066034be3fe2818e038e3f Mon Sep 17 00:00:00 2001 From: Guy Owen Date: Fri, 13 Oct 2023 16:41:42 +1100 Subject: [PATCH 3/5] [DDS-1723] Added debug tag. --- .github/workflows/build-deploy.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index b4c28c1a..02d4199e 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -44,6 +44,7 @@ jobs: ${{ 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 @@ -61,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 From 38199ad91ab19fc5b7c4c1819d2171ef621882e0 Mon Sep 17 00:00:00 2001 From: Guy Owen Date: Fri, 13 Oct 2023 17:04:12 +1100 Subject: [PATCH 4/5] [DDS-1723] Fixed job conditional. --- .github/workflows/build-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 02d4199e..b6be8231 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -15,7 +15,7 @@ env: REGISTRY: ghcr.io jobs: buildx: - 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) + if: github.event.pull_request.merged == true || contains(fromJson('["schedule", "workflow_dispatch", "pull_request"]'), github.event_name) runs-on: ubuntu-latest strategy: matrix: From 7dc11180e543920a11b3553208f627f3fec2cfa3 Mon Sep 17 00:00:00 2001 From: Guy Owen Date: Tue, 17 Oct 2023 13:20:51 +1100 Subject: [PATCH 5/5] [DDS-1723] Updated build conditionals. --- .github/workflows/build-deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index b6be8231..736c5ebc 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -6,7 +6,7 @@ on: workflow_dispatch: 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 || contains(fromJson('["schedule", "workflow_dispatch", "pull_request"]'), 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: