Skip to content

Commit dd6b8db

Browse files
committed
ci: setup deploy ci
1 parent ce7a39e commit dd6b8db

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [16.x]
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
- name: Cache pnpm modules
24+
uses: actions/cache@v3
25+
env:
26+
cache-name: cache-pnpm-modules
27+
with:
28+
path: ~/.pnpm-store
29+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
30+
restore-keys: |
31+
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
32+
- uses: pnpm/[email protected]
33+
with:
34+
version: latest
35+
run_install: |
36+
- recursive: true
37+
args: [--no-frozen-lockfile]
38+
- run: |
39+
pnpm run build
40+
mkdir -p dist
41+
cp -r docs/.vitepress/dist/* dist/
42+
echo 'mog.js.org' > dist/CNAME
43+
- name: Deploy
44+
uses: peaceiris/actions-gh-pages@v3
45+
with:
46+
github_token: ${{ secrets.GITHUB_TOKEN }}
47+
publish_dir: dist
48+
env:
49+
CI: true

0 commit comments

Comments
 (0)