-
Notifications
You must be signed in to change notification settings - Fork 9
52 lines (42 loc) · 1.25 KB
/
build-push-vercel.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
name: build-push-vercel
on:
push:
paths:
- 'documents/**'
- 'src/**'
- '.github/workflows/build-push-vercel.yml'
jobs:
doc:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache
uses: actions/cache@v4
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest
- name: env.sh
working-directory: src
run: chmod +x env.sh && ./env.sh
- name: Build
working-directory: src
run: pnpm build
- name: Vercel
working-directory: src/docs/.vuepress/dist
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_DOC }}
run: |
echo
pnpm add -g vercel
vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}