Skip to content

Commit 25663ee

Browse files
committed
chore: deploy docs
1 parent 293bd88 commit 25663ee

2 files changed

Lines changed: 62 additions & 4 deletions

File tree

.github/workflows/dev.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ jobs:
7777

7878
sync-locale:
7979
runs-on: ubuntu-24.04
80+
if: |
81+
github.event_name == 'push' &&
82+
contains(github.event.commits.*.added, 'locale') ||
83+
contains(github.event.commits.*.modified, 'locale') ||
84+
contains(github.event.commits.*.removed, 'locale')
8085
strategy:
8186
matrix:
8287
node-version: [18.x]
@@ -95,3 +100,44 @@ jobs:
95100
folder: locale
96101
clean: false
97102
commit-message: '[skip ci] sync locale'
103+
104+
build-docs:
105+
runs-on: ubuntu-24.04
106+
if: |
107+
github.event_name == 'push' &&
108+
contains(github.event.commits.*.added, 'docs') ||
109+
contains(github.event.commits.*.modified, 'docs') ||
110+
contains(github.event.commits.*.removed, 'docs')
111+
strategy:
112+
matrix:
113+
node-version: [18.x]
114+
steps:
115+
- uses: actions/checkout@v4
116+
- uses: pnpm/action-setup@v4
117+
with:
118+
version: 9
119+
- name: Use Node.js ${{ matrix.node-version }}
120+
uses: actions/setup-node@v4
121+
with:
122+
node-version: ${{ matrix.node-version }}
123+
- name: Install dependencies
124+
run: |
125+
cd $GITHUB_WORKSPACE/docs
126+
pnpm i
127+
- name: Build
128+
run: |
129+
cd $GITHUB_WORKSPACE/docs
130+
npm run build
131+
cp $GITHUB_WORKSPACE/scripts/www/* $GITHUB_WORKSPACE/docs/dist/
132+
- name: Deploy Cloudflare Pages
133+
uses: cloudflare/wrangler-action@v3
134+
with:
135+
apiToken: ${{ secrets.CF_API_TOKEN }}
136+
accountId: ${{ secrets.CF_ACCOUNT_ID }}
137+
command: pages deploy docs/dist --project-name=${{ vars.CF_PAGE_NAME }} --branch=dev
138+
- name: Deploy EdgeOne Pages
139+
env:
140+
EO_PAGE_TOKEN: ${{ secrets.EO_PAGE_TOKEN }}
141+
run: |
142+
npm i -g edgeone
143+
edgeone pages deploy $GITHUB_WORKSPACE/docs/dist -n ${{ vars.EO_PAGE_NAME }} -t $EO_PAGE_TOKEN -e preview

.github/workflows/main.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ concurrency:
1212
jobs:
1313
build-docs:
1414
runs-on: ubuntu-24.04
15+
if: |
16+
github.event_name == 'push' &&
17+
contains(github.event.commits.*.added, 'docs') ||
18+
contains(github.event.commits.*.modified, 'docs') ||
19+
contains(github.event.commits.*.removed, 'docs')
1520
strategy:
1621
matrix:
1722
node-version: [18.x]
@@ -33,8 +38,15 @@ jobs:
3338
cd $GITHUB_WORKSPACE/docs
3439
npm run build
3540
cp $GITHUB_WORKSPACE/scripts/www/* $GITHUB_WORKSPACE/docs/dist/
36-
- name: Deploy
37-
uses: JamesIves/github-pages-deploy-action@v4
41+
- name: Deploy Cloudflare Pages
42+
uses: cloudflare/wrangler-action@v3
3843
with:
39-
branch: gh-pages
40-
folder: docs/dist
44+
apiToken: ${{ secrets.CF_API_TOKEN }}
45+
accountId: ${{ secrets.CF_ACCOUNT_ID }}
46+
command: pages deploy docs/dist --project-name=${{ vars.CF_PAGE_NAME }}
47+
- name: Deploy EdgeOne Pages
48+
env:
49+
EO_PAGE_TOKEN: ${{ secrets.EO_PAGE_TOKEN }}
50+
run: |
51+
npm i -g edgeone
52+
edgeone pages deploy $GITHUB_WORKSPACE/docs/dist -n ${{ vars.EO_PAGE_NAME }} -t $EO_PAGE_TOKEN

0 commit comments

Comments
 (0)