From 458fa3fbee6891d57ebee8036bf1bb170a7c6293 Mon Sep 17 00:00:00 2001 From: Benjamin Michaelis Date: Wed, 13 May 2026 16:59:27 -0700 Subject: [PATCH] Add merge_group trigger and fix Docker caching in CI workflows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - PR-Build-And-Test.yml: Add merge_group trigger so Docker validation and tests run in the GitHub merge queue - PR-Build-And-Test.yml: Replace outputs: type=docker,dest=*.tar with push: false — tar was never uploaded as artifact; this skips the slow layer extraction while still populating the GHA cache - Build-Test-And-Deploy.yml: Remove dead "Docker build (no push)" step whose condition (pull_request || merge_group) could never be true since the workflow only triggers on push to main and workflow_dispatch; PR/merge_group validation is now handled by PR-Build-And-Test.yml Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/Build-Test-And-Deploy.yml | 11 ----------- .github/workflows/PR-Build-And-Test.yml | 3 ++- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/Build-Test-And-Deploy.yml b/.github/workflows/Build-Test-And-Deploy.yml index 6870ca55..5afc3a7c 100644 --- a/.github/workflows/Build-Test-And-Deploy.yml +++ b/.github/workflows/Build-Test-And-Deploy.yml @@ -63,17 +63,6 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v4 - # Build but no push with a PR - - name: Docker build (no push) - if: github.event_name == 'pull_request' || github.event_name == 'merge_group' - uses: docker/build-push-action@v7 - with: - push: false - tags: temp-pr-validation - file: ./EssentialCSharp.Web/Dockerfile - context: . - build-args: ACCESS_TO_NUGET_FEED=false - # Only build for dev registry — prod gets the image via az acr import in deploy-production - name: Build Container Image if: github.event_name != 'pull_request_target' && github.event_name != 'pull_request' diff --git a/.github/workflows/PR-Build-And-Test.yml b/.github/workflows/PR-Build-And-Test.yml index 9793b743..e7b3bc4b 100644 --- a/.github/workflows/PR-Build-And-Test.yml +++ b/.github/workflows/PR-Build-And-Test.yml @@ -3,6 +3,7 @@ name: PR Build and Test EssentialCSharp.Web on: pull_request: branches: ["main"] + merge_group: workflow_dispatch: jobs: @@ -67,7 +68,7 @@ jobs: with: file: ./EssentialCSharp.Web/Dockerfile context: . - outputs: type=docker,dest=${{ github.workspace }}/essentialcsharpwebimage.tar + push: false cache-from: type=gha cache-to: type=gha,mode=max build-args: ACCESS_TO_NUGET_FEED=false