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

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


The following commit(s) were added to refs/heads/main by this push:
     new 19c441f8019 ci: generate documentation PDFs on schedule or manual 
dispatch (#1153)
19c441f8019 is described below

commit 19c441f8019fe6cbd49337569822fb2faf6cd601
Author: Liming Deng <[email protected]>
AuthorDate: Sat Oct 10 11:29:56 2026 +0800

    ci: generate documentation PDFs on schedule or manual dispatch (#1153)
---
 .github/workflows/deploy.yml       | 17 ++++------
 .github/workflows/generate-pdf.yml | 65 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 72 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 0c52571fb92..b80262f8748 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -1,6 +1,7 @@
 name: Website Deploy
 
 on:
+  workflow_dispatch: # Enable manually build
   pull_request:
   push:
     branches:
@@ -10,6 +11,12 @@ jobs:
   build_and_deploy_job:
     runs-on: ubuntu-latest
     name: Build and Deploy Job
+    permissions:
+      contents: write
+    # Serialize writes to asf-site across website and PDF publishing.
+    concurrency:
+      group: ${{ github.event_name == 'push' && 'asf-site-publish' || 
format('website-pr-{0}', github.event.pull_request.number) }}
+      cancel-in-progress: false
     steps:
       -
         name: Checkout Code
@@ -24,16 +31,6 @@ jobs:
       - 
         name: Setup Dependencies
         run: yarn install
-      -
-        name: Setup Python
-        uses: actions/setup-python@v2
-        with:
-          python-version: 3.8
-      -
-        name: Generate PDF
-        run: |
-          bash .github/scripts/generate-pdf.sh
-          cp -r pdf/ static/
       - 
         name: Build Site
         run: yarn build
diff --git a/.github/workflows/generate-pdf.yml 
b/.github/workflows/generate-pdf.yml
new file mode 100644
index 00000000000..ccf48467259
--- /dev/null
+++ b/.github/workflows/generate-pdf.yml
@@ -0,0 +1,65 @@
+name: Documentation PDFs
+
+on:
+  schedule:
+    # Mondays at 02:17 UTC (10:17 Asia/Shanghai).
+    - cron: '17 2 * * 1'
+  workflow_dispatch:
+
+permissions:
+  contents: read
+
+jobs:
+  generate_pdf:
+    # Forks can test manually without automatically running the weekly build.
+    if: github.repository == 'apache/shenyu-website' || github.event_name == 
'workflow_dispatch'
+    runs-on: ubuntu-latest
+    name: Generate Documentation PDFs
+    steps:
+      - name: Checkout Code
+        uses: actions/checkout@v4
+        with:
+          submodules: recursive
+      - name: Setup Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: '3.8'
+      - name: Generate PDF
+        run: |
+          bash -e .github/scripts/generate-pdf.sh
+          test -s pdf/apache_shenyu_docs_en.pdf
+          test -s pdf/apache_shenyu_docs_zh.pdf
+      - name: Upload PDFs
+        uses: actions/upload-artifact@v4
+        with:
+          name: documentation-pdfs
+          path: pdf/*.pdf
+          if-no-files-found: error
+
+  publish_pdf:
+    needs: generate_pdf
+    if: github.repository == 'apache/shenyu-website' && github.ref == 
'refs/heads/main'
+    runs-on: ubuntu-latest
+    name: Publish Documentation PDFs
+    permissions:
+      contents: write
+    concurrency:
+      group: asf-site-publish
+      cancel-in-progress: false
+    steps:
+      - name: Checkout Code
+        uses: actions/checkout@v4
+      - name: Download PDFs
+        uses: actions/download-artifact@v4
+        with:
+          name: documentation-pdfs
+          path: pdf
+      - name: Publish PDFs
+        uses: peaceiris/actions-gh-pages@v3
+        with:
+          github_token: ${{ secrets.GITHUB_TOKEN }}
+          user_name: 'github-actions[bot]'
+          user_email: 'github-actions[bot]@users.noreply.github.com'
+          publish_branch: asf-site
+          publish_dir: ./pdf
+          destination_dir: pdf

Reply via email to