This is an automated email from the ASF dual-hosted git repository.

LinkinStars pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/answer-website.git


The following commit(s) were added to refs/heads/main by this push:
     new 85a9ea0cc chore: update deployment process to comply with Apache's 
Actions policy
85a9ea0cc is described below

commit 85a9ea0cc401adfcc71be088f50421351aaee7b0
Author: LinkinStars <[email protected]>
AuthorDate: Fri Oct 9 11:35:57 2026 +0800

    chore: update deployment process to comply with Apache's Actions policy
---
 .github/workflows/deploy.yml | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 80073167c..33dcb8ebf 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -27,10 +27,12 @@ jobs:
         with:
           node-version: 20
 
-      - name: install dependencies
-        uses: pnpm/action-setup@v4
-        with:
-          version: 9
+      # Apache's Actions policy permits only approved actions.  Install pnpm
+      # through Node's bundled Corepack instead of pnpm/action-setup.
+      - name: Set up pnpm
+        run: |
+          corepack enable
+          corepack prepare pnpm@9 --activate
       - name: Get pnpm store directory
         shell: bash
         run: |
@@ -53,9 +55,17 @@ jobs:
       - name: build
         run: pnpm run build
 
-      - uses: peaceiris/actions-gh-pages@v4
+      # Keep publishing to the existing dist-pages branch without a third-party
+      # action, which is blocked by Apache's Actions policy.
+      - name: Publish site
         if: github.event_name != 'pull_request'
-        with:
-          github_token: ${{ secrets.GITHUB_TOKEN }}
-          publish_dir: ./build
-          publish_branch: dist-pages
+        run: |
+          publish_dir="$(mktemp -d)"
+          git worktree add --detach "$publish_dir" origin/dist-pages
+          rsync -a --delete build/ "$publish_dir/"
+          cd "$publish_dir"
+          git config user.name "github-actions[bot]"
+          git config user.email 
"41898282+github-actions[bot]@users.noreply.github.com"
+          git add --all
+          git diff --cached --quiet || git commit -m "deploy: ${GITHUB_SHA}"
+          git push origin HEAD:dist-pages

Reply via email to