forked from isar/isar
-
Notifications
You must be signed in to change notification settings - Fork 25
74 lines (65 loc) · 1.77 KB
/
docs.yaml
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
70
71
72
73
74
name: Unified Deploy Docs
on:
push:
branches:
- main
- v3
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
contents: write
id-token: write
pages: write
steps:
- name: Checkout v3 branch
uses: actions/checkout@v4
with:
ref: "v3"
path: "v3"
- name: Build v3 docs
run: |
cd v3
git fetch --unshallow
git fetch --tags
tool/replace-versions.sh
cd docs
sed -i'.bak' "s|base:.*|base: '/v3/',|" docs/.vuepress/config.ts
sed -i 's|text: "vx.x"|text: "v3.x"|' docs/.vuepress/config.ts
npm ci
npm run build
mv ./docs/.vuepress/dist ../../v3-docs
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: "main"
path: "main"
- name: Build main docs
run: |
cd main
git fetch --tags
tool/replace-versions.sh
cd docs
sed -i'.bak' "s|base:.*|base: '/',|" docs/.vuepress/config.ts
sed -i 's|text: "vx.x"|text: "v4.x"|' docs/.vuepress/config.ts
npm ci
npm run build
mv ./docs/.vuepress/dist ../../main-docs
- name: Prepare deployment directory
run: |
mkdir deploy
mv main-docs/* deploy/
mkdir deploy/v3
mv v3-docs/* deploy/v3/
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: deploy
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4