From 3234bb5b5d95f1ccd555843a77d03a372ebdbb9b Mon Sep 17 00:00:00 2001 From: Vedran Ivanac Date: Mon, 9 Mar 2026 12:23:02 +0100 Subject: [PATCH 1/3] Fix it --- .github/actions/deploy-to-gh-pages/action.yml | 25 +++++++++++++++++++ .github/workflows/ci.yaml | 2 +- .github/workflows/cleanup-previews.yml | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/actions/deploy-to-gh-pages/action.yml b/.github/actions/deploy-to-gh-pages/action.yml index 25f5bf1991..c812b4f578 100644 --- a/.github/actions/deploy-to-gh-pages/action.yml +++ b/.github/actions/deploy-to-gh-pages/action.yml @@ -34,6 +34,31 @@ runs: id: deployment uses: actions/deploy-pages@v4 + - name: Sync content to gh-pages branch + shell: bash + run: | + cd "${{ inputs.content-path }}" + + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + if [ ! -d ".git" ]; then + git init -b gh-pages + git remote add origin "https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git" + fi + + git add -A + if git diff --cached --quiet; then + echo "gh-pages branch already up to date" + else + git commit -m "Sync: ${{ inputs.deployment-name }}" + if git push origin gh-pages; then + echo "gh-pages branch synced with deployment" + else + echo "::warning::Failed to sync gh-pages branch (concurrent deployment?). Next deployment will self-heal." + fi + fi + - name: Deployment summary shell: bash run: | diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 443bfba4fc..8bb7b7ff0b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -117,7 +117,7 @@ jobs: name: Deploy Picasso docs runs-on: ubuntu-latest concurrency: - group: gh-pages-deployment-pr + group: gh-pages-deployment cancel-in-progress: false permissions: contents: write diff --git a/.github/workflows/cleanup-previews.yml b/.github/workflows/cleanup-previews.yml index 770132c629..871f9cfcfa 100644 --- a/.github/workflows/cleanup-previews.yml +++ b/.github/workflows/cleanup-previews.yml @@ -26,7 +26,7 @@ on: - force_all concurrency: - group: gh-pages-deployment-pr + group: gh-pages-deployment cancel-in-progress: false jobs: From 1adfda69c6fbeaeb619dff4f09cdb28d22c29e0f Mon Sep 17 00:00:00 2001 From: Vedran Ivanac Date: Mon, 9 Mar 2026 12:58:31 +0100 Subject: [PATCH 2/3] Fix it --- .github/actions/deploy-to-gh-pages/action.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/actions/deploy-to-gh-pages/action.yml b/.github/actions/deploy-to-gh-pages/action.yml index c812b4f578..7f9ef2ae04 100644 --- a/.github/actions/deploy-to-gh-pages/action.yml +++ b/.github/actions/deploy-to-gh-pages/action.yml @@ -52,11 +52,7 @@ runs: echo "gh-pages branch already up to date" else git commit -m "Sync: ${{ inputs.deployment-name }}" - if git push origin gh-pages; then - echo "gh-pages branch synced with deployment" - else - echo "::warning::Failed to sync gh-pages branch (concurrent deployment?). Next deployment will self-heal." - fi + git push origin gh-pages fi - name: Deployment summary From e825b7d80ecd356c9987ca964f881785577220c2 Mon Sep 17 00:00:00 2001 From: Vedran Ivanac Date: Mon, 9 Mar 2026 13:32:01 +0100 Subject: [PATCH 3/3] Fix it --- .github/actions/deploy-to-gh-pages/action.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/actions/deploy-to-gh-pages/action.yml b/.github/actions/deploy-to-gh-pages/action.yml index 7f9ef2ae04..461c1f7512 100644 --- a/.github/actions/deploy-to-gh-pages/action.yml +++ b/.github/actions/deploy-to-gh-pages/action.yml @@ -45,6 +45,16 @@ runs: if [ ! -d ".git" ]; then git init -b gh-pages git remote add origin "https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git" + else + # Ensure we're on gh-pages branch (the failed checkout may have + # left us on 'master' after git init with no gh-pages ref) + CURRENT_BRANCH=$(git branch --show-current 2>/dev/null || echo "") + if [ "$CURRENT_BRANCH" != "gh-pages" ]; then + git checkout -B gh-pages + fi + # Ensure remote URL uses the token for authentication + git remote set-url origin "https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git" 2>/dev/null || \ + git remote add origin "https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git" fi git add -A