From b62be4399e93af8a77bf5aab075c06a30d245d6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shixiang=20Wang=20=28=E7=8E=8B=E8=AF=97=E7=BF=94=29?= Date: Fri, 9 Oct 2026 12:00:53 +0800 Subject: [PATCH] ci: migrate Pages deploy to actions/deploy-pages Replace quarto publish --target gh-pages with the official actions/deploy-pages flow (upload-pages-artifact, configure-pages, deploy-pages) in both publish workflows. Motivation: the legacy gh-pages target force-pushes the entire rendered site (~493 MB) to the gh-pages branch on every deploy, growing the repository history indefinitely. This is the main driver of repository growth tracked in issue #306 (item A1). With this change the site is packaged as the github-pages artifact and deployed directly to the github-pages environment. The Upload Quarto artifacts step keeps its original conditions; Configure/Deploy are skipped for pull_request events (same conditions as the previous deploy step). Note: after this migration is verified live, the gh-pages branch can be deleted (Pages source switches from branch-based to workflow-based automatically on the first deploy-pages run). Refs: #306 Co-Authored-By: Claude Code --- .../workflows/quarto-publish-update-cache.yml | 16 +++++++++++----- .github/workflows/quarto-publish.yml | 17 ++++++++++++----- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.github/workflows/quarto-publish-update-cache.yml b/.github/workflows/quarto-publish-update-cache.yml index fea4d0bc8..2431aa6bb 100644 --- a/.github/workflows/quarto-publish-update-cache.yml +++ b/.github/workflows/quarto-publish-update-cache.yml @@ -390,18 +390,24 @@ jobs: key: freeze-${{ runner.os }}-nightly-${{ github.run_id }} # ── Deploy ─────────────────────────────────────────────── + # Official actions/deploy-pages flow: package _site as the + # github-pages artifact, then deploy it straight to the + # github-pages environment. This replaces quarto publish --target + # gh-pages, which pushed the entire site to the gh-pages branch on + # every deploy (~493 MB per push, the main driver of repository + # growth tracked in issue #306). - name: Upload Quarto artifacts uses: actions/upload-pages-artifact@v3 with: path: "_site" + - name: Configure GitHub Pages + uses: actions/configure-pages@v6 + - name: Deploy to GitHub Pages - uses: quarto-dev/quarto-actions/publish@v2 + uses: actions/deploy-pages@v5 with: - target: gh-pages - render: false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + artifact_name: github-pages - name: Cleanup temporary directory if: always() diff --git a/.github/workflows/quarto-publish.yml b/.github/workflows/quarto-publish.yml index ad27c32cd..e49873441 100644 --- a/.github/workflows/quarto-publish.yml +++ b/.github/workflows/quarto-publish.yml @@ -526,20 +526,27 @@ jobs: key: freeze-${{ runner.os }}-${{ github.sha }}-${{ github.run_attempt }} # ── Deploy ─────────────────────────────────────────────── + # Official actions/deploy-pages flow: package _site as the + # github-pages artifact, then deploy it straight to the + # github-pages environment. This replaces quarto publish --target + # gh-pages, which pushed the entire site to the gh-pages branch on + # every deploy (~493 MB per push, the main driver of repository + # growth tracked in issue #306). - name: Upload Quarto artifacts if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event_name == 'pull_request' uses: actions/upload-pages-artifact@v3 with: path: "_site" + - name: Configure GitHub Pages + if: github.event_name != 'pull_request' + uses: actions/configure-pages@v6 + - name: Deploy to GitHub Pages if: github.event_name != 'pull_request' - uses: quarto-dev/quarto-actions/publish@v2 + uses: actions/deploy-pages@v5 with: - target: gh-pages - render: false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + artifact_name: github-pages - name: Cleanup temporary directory if: always()