Skip to content

Commit 79e9a0c

Browse files
robinclaude
andcommitted
chore(ci): add GitHub Pages deploy and skip TCB when secrets missing
- Add deploy-pages.yml for GitHub Pages deployment - Skip TCB deploy step when TCB_SECRET_ID is not configured Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
1 parent c63381a commit 79e9a0c

2 files changed

Lines changed: 68 additions & 0 deletions

File tree

.github/workflows/deploy-pages.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Deploy Docs to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- next
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: pages
16+
cancel-in-progress: false
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Install pnpm
25+
uses: pnpm/action-setup@v4
26+
with:
27+
version: 9
28+
29+
- name: Use Node.js 18.x
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: 18.x
33+
cache: pnpm
34+
35+
- name: Install dependencies
36+
run: pnpm install --shamefully-hoist
37+
env:
38+
NODE_OPTIONS: --openssl-legacy-provider
39+
40+
- name: Build taro-ui
41+
run: pnpm run build:ui
42+
env:
43+
NODE_OPTIONS: --openssl-legacy-provider
44+
45+
- name: Build taro-ui-docs
46+
run: pnpm run build:doc
47+
env:
48+
NODE_OPTIONS: --openssl-legacy-provider
49+
50+
- name: Setup Pages
51+
uses: actions/configure-pages@v5
52+
53+
- name: Upload artifact
54+
uses: actions/upload-pages-artifact@v3
55+
with:
56+
path: packages/taro-ui-docs/dist
57+
58+
deploy:
59+
environment:
60+
name: github-pages
61+
url: ${{ steps.deployment.outputs.page_url }}
62+
runs-on: ubuntu-latest
63+
needs: build
64+
steps:
65+
- name: Deploy to GitHub Pages
66+
id: deployment
67+
uses: actions/deploy-pages@v4

.github/workflows/deploy-tcb.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444

4545
- name: Deploy static to Tencent CloudBase
4646
id: deployStatic
47+
if: ${{ secrets.TCB_SECRET_ID != '' }}
4748
uses: TencentCloudBase/[email protected]
4849
with:
4950
secretId: ${{ secrets.TCB_SECRET_ID }}

0 commit comments

Comments
 (0)