Skip to content

Commit 178637b

Browse files
Add GitHub Pages deploy workflow for website + docs
1 parent 7b99cce commit 178637b

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Deploy to 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+
- uses: actions/checkout@v4
22+
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
27+
# Build the Starlight docs site
28+
- name: Install docs dependencies
29+
working-directory: docs
30+
run: npm ci
31+
32+
- name: Build docs
33+
working-directory: docs
34+
run: npm run build
35+
36+
# Combine website + docs into a single site
37+
# website/ → root (lightshell.sh/)
38+
# docs/ → /docs/ (lightshell.sh/docs/)
39+
- name: Assemble site
40+
run: |
41+
mkdir -p _site
42+
cp -r website/* _site/
43+
cp -r docs/dist/* _site/docs/ 2>/dev/null || mkdir -p _site/docs && cp -r docs/dist/* _site/docs/
44+
45+
- name: Upload Pages artifact
46+
uses: actions/upload-pages-artifact@v3
47+
with:
48+
path: _site
49+
50+
deploy:
51+
needs: build
52+
runs-on: ubuntu-latest
53+
environment:
54+
name: github-pages
55+
url: ${{ steps.deployment.outputs.page_url }}
56+
steps:
57+
- name: Deploy to GitHub Pages
58+
id: deployment
59+
uses: actions/deploy-pages@v4

docs/astro.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import starlight from '@astrojs/starlight';
44

55
// https://astro.build/config
66
export default defineConfig({
7+
base: '/docs',
78
integrations: [
89
starlight({
910
title: 'LightShell Docs',

0 commit comments

Comments
 (0)