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

moonming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-website.git


The following commit(s) were added to refs/heads/master by this push:
     new b171afa2df7 fix(ci): validate full deploy before merge (#2090)
b171afa2df7 is described below

commit b171afa2df76e4dada2403c5edc1d70535b2dd34
Author: Ming Wen <[email protected]>
AuthorDate: Mon Aug 3 13:25:37 2026 +0800

    fix(ci): validate full deploy before merge (#2090)
    
    * fix(ci): validate full deploy before merge
    
    * fix(ci): isolate publishing from PR builds
---
 .github/workflows/deploy.yml | 59 ++++++++++++++++++++++++++++----------------
 1 file changed, 38 insertions(+), 21 deletions(-)

diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index bf91cf8ca1d..eef527d1a04 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -7,6 +7,8 @@ name: Test and Deploy Website
 on:
   push:
     branches: [master]
+  pull_request:
+    branches: [master]
   schedule:
     # Run everyday at 9:00 AM (See 
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07)
     - cron: '0 5 * * *'
@@ -17,12 +19,18 @@ on:
         required: true
         default: 'master'
 
-# A workflow run is made up of one or more jobs that can run sequentially or 
in parallel
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || 
github.run_id }}
+  cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+
+# Build and validate with read-only permissions; publish only from trusted 
events.
 jobs:
-  # This workflow contains a single job called "build"
   build:
     # The type of runner that the job will run on
     runs-on: ubuntu-latest
+    timeout-minutes: 60
+    permissions:
+      contents: read
 
     # Steps represent a sequence of tasks that will be executed as part of the 
job
     steps:
@@ -392,11 +400,12 @@ jobs:
           # The version-less pages are built by Astro, so this is the only
           # place their cross-site canonical can be checked — the Docusaurus
           # assertion earlier in this job covers the versioned pages.
-          for f in website/build/docs/apisix/plugins/cors/index.html \
-                   website/build/zh/docs/apisix/plugins/cors/index.html; do
-            test "$(grep -o 'rel="canonical"' "$f" | wc -l)" -eq 1
-            grep -q 'rel="canonical" href="https://docs.api7.ai/hub/cors";' "$f"
-          done
+          f=website/build/docs/apisix/plugins/cors/index.html
+          test "$(grep -o 'rel="canonical"' "$f" | wc -l)" -eq 1
+          grep -q 'rel="canonical" href="https://docs.api7.ai/hub/cors";' "$f"
+          f=website/build/zh/docs/apisix/plugins/cors/index.html
+          test "$(grep -o 'rel="canonical"' "$f" | wc -l)" -eq 1
+          grep -q 'rel="canonical" href="https://docs.apiseven.com/hub/cors";' 
"$f"
           grep -q 'property="og:url" 
content="https://apisix.apache.org/docs/apisix/plugins/cors/";' \
             website/build/docs/apisix/plugins/cors/index.html
           # Fail the deploy if the landing pages are not the Astro build, or
@@ -476,24 +485,32 @@ jobs:
           PLAYWRIGHT_WEB_SERVER_COMMAND: python3 -m http.server 4321 --bind 
127.0.0.1 --directory ../website/build
           EXPECT_DOCUSARUS_ROUTES: 'true'
 
-      - name: Deploy to Netlify
-        uses: ./.github/actions/actions-netlify
-        if: ${{ false }}
+      - name: Upload final site for publishing
+        if: ${{ (github.event_name == 'push' && github.ref == 
'refs/heads/master') || github.event_name == 'schedule' }}
+        uses: actions/upload-artifact@v4
         with:
-          publish-dir: './website/build'
-          github-token: ${{ secrets.GITHUB_TOKEN }}
-          deploy-message: '${{ github.event.pull_request.title }}, Deploy from 
GitHub Actions'
-          enable-pull-request-comment: true
-          enable-commit-comment: true
-          overwrites-pull-request-comment: true
-        env:
-          NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
-          NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
-        timeout-minutes: 10
+          name: website-build
+          path: website/build
+          include-hidden-files: true
+          retention-days: 1
+
+  publish:
+    needs: build
+    if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') 
|| github.event_name == 'schedule' }}
+    runs-on: ubuntu-latest
+    timeout-minutes: 10
+    permissions:
+      actions: read
+      contents: write
+    steps:
+      - name: Download final site
+        uses: actions/download-artifact@v4
+        with:
+          name: website-build
+          path: website/build
 
       - name: Deploy
         uses: peaceiris/[email protected]
-        if: github.event_name == 'push' && github.ref == 'refs/heads/master' 
|| github.event_name == 'schedule'
         with:
           github_token: ${{ secrets.GITHUB_TOKEN }}
           publish_dir: website/build

Reply via email to