-
Notifications
You must be signed in to change notification settings - Fork 368
69 lines (67 loc) · 1.83 KB
/
v2-site.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: V2 Site
on:
pull_request:
branches:
- v2 # default branch
env:
CI: true
PNPM_STORE: .pnpm-store
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
node-version: [latest]
steps:
- name: checkout code repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Switch to site branch
run: git checkout -b gh-pages
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: install pnpm
run: npm i pnpm@latest -g
- name: Setup npmrc
run: |
cat << EOF > "$HOME/.npmrc"
email=${NPM_EMAIL}
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_EMAIL: ${{ secrets.NPM_EMAIL }}
- name: setup pnpm config
run: pnpm config set store-dir $PNPM_STORE
- name: install dependencies
run: pnpm install
- name: build site
run: |
pnpm run build:lib
pnpm run build:site
- name: copy and delete files
run: |
find . -maxdepth 1 -type f -exec rm -f {} \;
cp -r site/dist/* ./
rm -rf site
rm -rf node_modules
rm -rf packages
rm -rf scripts
rm -rf public
rm -rf config
rm -rf template
rm -rf .changeset
rm -rf .github
rm -rf $PNPM_STORE
- name: commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "lxfu1"
git add .
git commit -m "chore: update site"
- name: push to gh-pages branch
run: git push origin gh-pages -f