Skip to content

Commit 322dbd2

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 322dbd2

2 files changed

Lines changed: 54 additions & 0 deletions

File tree

.github/workflows/deploy-pages.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Deploy Docs to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- next
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
pages: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: false
16+
17+
jobs:
18+
deploy:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Install pnpm
24+
uses: pnpm/action-setup@v4
25+
with:
26+
version: 9
27+
28+
- name: Use Node.js 18.x
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: 18.x
32+
cache: pnpm
33+
34+
- name: Install dependencies
35+
run: pnpm install --shamefully-hoist
36+
env:
37+
NODE_OPTIONS: --openssl-legacy-provider
38+
39+
- name: Build taro-ui
40+
run: pnpm run build:ui
41+
env:
42+
NODE_OPTIONS: --openssl-legacy-provider
43+
44+
- name: Build taro-ui-docs
45+
run: pnpm run build:doc
46+
env:
47+
NODE_OPTIONS: --openssl-legacy-provider
48+
49+
- name: Deploy to GitHub Pages
50+
uses: peaceiris/actions-gh-pages@v4
51+
with:
52+
github_token: ${{ secrets.GITHUB_TOKEN }}
53+
publish_dir: packages/taro-ui-docs/dist

.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)