-
Notifications
You must be signed in to change notification settings - Fork 10
82 lines (68 loc) · 2.05 KB
/
Copy pathdeploy.yml
File metadata and controls
82 lines (68 loc) · 2.05 KB
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
75
76
77
78
79
80
81
82
name: Deploy versioned VitePress sites to Pages
on:
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
name: Build Basalt 2.0 and 2.5 docs
runs-on: ubuntu-22.04
steps:
- name: Checkout deployment automation
uses: actions/checkout@v6
with:
ref: main
path: automation
- name: Checkout documentation branch
uses: actions/checkout@v6
with:
ref: gh-pages
path: site
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 20
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install VitePress dependencies
working-directory: site
run: npm ci
- name: Build Basalt 2.0 and 2.5 sites
working-directory: site
run: |
mkdir -p "$RUNNER_TEMP/pages/2.0"
mkdir -p "$RUNNER_TEMP/pages/2.5"
mv docs/.vitepress/config.mts \
docs/.vitepress/config.base.mts
cp ../automation/.github/vitepress-2.0.config.mts \
docs/.vitepress/config.mts
npx vitepress build docs \
--outDir "$RUNNER_TEMP/pages/2.0"
npx vitepress build docs/2.5 \
--outDir "$RUNNER_TEMP/pages/2.5"
cp ../automation/.github/pages-index.html \
"$RUNNER_TEMP/pages/index.html"
touch "$RUNNER_TEMP/pages/.nojekyll"
node ../automation/.github/scripts/create-version-redirects.mjs \
"$RUNNER_TEMP/pages/2.0" \
"$RUNNER_TEMP/pages"
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{ runner.temp }}/pages
deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy GitHub Pages
id: deployment
uses: actions/deploy-pages@v4