Skip to content

Commit deb0649

Browse files
committed
ci: deploy docs
1 parent 7358190 commit deb0649

2 files changed

Lines changed: 61 additions & 0 deletions

File tree

.github/workflows/docs-pages.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Docs (GitHub Pages)
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
- name: Setup Node
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 20
27+
cache: npm
28+
cache-dependency-path: docs-starlight/package-lock.json
29+
- name: Configure Pages
30+
uses: actions/configure-pages@v5
31+
- name: Install D2
32+
run: curl -fsSL https://d2lang.com/install.sh | sh -s --
33+
- name: Install dependencies
34+
run: npm ci
35+
working-directory: docs-starlight
36+
- name: Build site
37+
run: npm run build
38+
working-directory: docs-starlight
39+
env:
40+
SITE: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/
41+
BASE: /${{ github.event.repository.name }}/
42+
- name: Upload Pages artifact
43+
uses: actions/upload-pages-artifact@v3
44+
with:
45+
path: docs-starlight/dist
46+
47+
deploy:
48+
needs: build
49+
runs-on: ubuntu-latest
50+
environment:
51+
name: github-pages
52+
url: ${{ steps.deployment.outputs.page_url }}
53+
steps:
54+
- name: Deploy to GitHub Pages
55+
id: deployment
56+
uses: actions/deploy-pages@v4

docs-starlight/astro.config.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ import starlightThemeRapide from "starlight-theme-rapide";
66
import d2 from "astro-d2";
77

88
// https://astro.build/config
9+
const site = process.env.SITE;
10+
const base = process.env.BASE;
11+
912
export default defineConfig({
13+
site,
14+
base,
1015
integrations: [
1116
starlight({
1217
plugins: [starlightThemeRapide()],

0 commit comments

Comments
 (0)