From 008565e3e4dc503d8f423cb90da841b46896bbce Mon Sep 17 00:00:00 2001 From: Anthony Guimard Date: Fri, 23 Oct 2026 17:46:39 +0200 Subject: [PATCH 1/2] ci: deploy the api reference from the main tip only, one deploy at a time --- .github/workflows/build.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7d3bf6a6b7..18bf78f04b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -344,10 +344,30 @@ jobs: name: github-pages url: ${{ steps.deployment.outputs.page_url }} if: github.event_name == 'push' && github.ref == 'refs/heads/main' + concurrency: + group: pages-${{ github.ref }} + cancel-in-progress: false needs: [build-api-reference, send-coverage, lint, bff-integration-tests] steps: + - name: Check this run still builds the branch tip + id: tip + env: + GH_TOKEN: ${{ github.token }} + REPO: ${{ github.repository }} + BRANCH: ${{ github.ref_name }} + SHA: ${{ github.sha }} + run: | + TIP_SHA=$(gh api "repos/$REPO/git/ref/heads/$BRANCH" --jq .object.sha) + if [ "$TIP_SHA" = "$SHA" ]; then + echo "is_tip=true" >> "$GITHUB_OUTPUT" + else + echo "is_tip=false" >> "$GITHUB_OUTPUT" + echo "::notice::Skipping the Pages deploy: $SHA is no longer the tip of $BRANCH ($TIP_SHA), whose run publishes the newer reference." + fi - name: Setup Pages + if: steps.tip.outputs.is_tip == 'true' uses: actions/configure-pages@v3 - name: Deploy to GitHub Pages id: deployment + if: steps.tip.outputs.is_tip == 'true' uses: actions/deploy-pages@v4 From 153f11993468e920b1337330b50e12baf621d9ae Mon Sep 17 00:00:00 2001 From: Anthony Guimard Date: Fri, 23 Oct 2026 17:51:07 +0200 Subject: [PATCH 2/2] ci: keep the pages deploy when only skip-ci release commits follow --- .github/workflows/build.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 18bf78f04b..92fcf47fc3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -349,25 +349,26 @@ jobs: cancel-in-progress: false needs: [build-api-reference, send-coverage, lint, bff-integration-tests] steps: - - name: Check this run still builds the branch tip - id: tip + - name: Check no newer commit on the branch will publish + id: newest env: GH_TOKEN: ${{ github.token }} REPO: ${{ github.repository }} BRANCH: ${{ github.ref_name }} SHA: ${{ github.sha }} run: | - TIP_SHA=$(gh api "repos/$REPO/git/ref/heads/$BRANCH" --jq .object.sha) - if [ "$TIP_SHA" = "$SHA" ]; then - echo "is_tip=true" >> "$GITHUB_OUTPUT" + NEWER_BUILDS=$(gh api "repos/$REPO/compare/$SHA...$BRANCH" \ + --jq '[.commits[].commit.message | select(test("\\[(skip ci|ci skip|no ci|skip actions|actions skip)\\]"; "i") | not)] | length') + if [ "$NEWER_BUILDS" = "0" ]; then + echo "publish=true" >> "$GITHUB_OUTPUT" else - echo "is_tip=false" >> "$GITHUB_OUTPUT" - echo "::notice::Skipping the Pages deploy: $SHA is no longer the tip of $BRANCH ($TIP_SHA), whose run publishes the newer reference." + echo "publish=false" >> "$GITHUB_OUTPUT" + echo "::notice::Skipping the Pages deploy: $NEWER_BUILDS newer commit(s) on $BRANCH start their own run, which publishes the newer reference." fi - name: Setup Pages - if: steps.tip.outputs.is_tip == 'true' + if: steps.newest.outputs.publish == 'true' uses: actions/configure-pages@v3 - name: Deploy to GitHub Pages id: deployment - if: steps.tip.outputs.is_tip == 'true' + if: steps.newest.outputs.publish == 'true' uses: actions/deploy-pages@v4