Skip to content

Commit a9cc8f8

Browse files
committed
ci(docs): add pages workflow
1 parent 499c939 commit a9cc8f8

3 files changed

Lines changed: 90 additions & 0 deletions

File tree

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/_build/
22
/deps/
33
/assets/node_modules/
4+
/docs-site/
45
/.elixir_ls/
56
/.git/
67
/cover/

.github/workflows/docs.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: docs
2+
3+
on:
4+
pull_request:
5+
push:
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: docs-${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
check:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v6
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v6
26+
with:
27+
node-version: '26.2.0'
28+
cache: npm
29+
cache-dependency-path: docs-site/package-lock.json
30+
31+
- name: Install docs dependencies
32+
run: npm ci --prefix docs-site
33+
34+
- name: Check docs
35+
run: npm run check --prefix docs-site
36+
37+
- name: Build docs
38+
run: npm run build --prefix docs-site
39+
40+
deploy:
41+
if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
42+
needs: check
43+
runs-on: ubuntu-latest
44+
permissions:
45+
contents: read
46+
pages: write
47+
id-token: write
48+
environment:
49+
name: github-pages
50+
url: ${{ steps.deployment.outputs.page_url }}
51+
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v6
55+
with:
56+
fetch-depth: 0
57+
58+
- name: Setup Node.js
59+
uses: actions/setup-node@v6
60+
with:
61+
node-version: '26.2.0'
62+
cache: npm
63+
cache-dependency-path: docs-site/package-lock.json
64+
65+
- name: Install docs dependencies
66+
run: npm ci --prefix docs-site
67+
68+
- name: Check docs
69+
run: npm run check --prefix docs-site
70+
71+
- name: Build docs
72+
run: npm run build --prefix docs-site
73+
74+
- name: Configure Pages
75+
uses: actions/configure-pages@v6.0.0
76+
77+
- name: Upload Pages artifact
78+
uses: actions/upload-pages-artifact@v5.0.0
79+
with:
80+
path: docs-site/dist
81+
82+
- name: Deploy Pages
83+
id: deployment
84+
uses: actions/deploy-pages@v5.0.0

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ codex_pooler-*.tar
6262
# In case you use Node.js/npm, you want to ignore these.
6363
npm-debug.log
6464
/assets/node_modules/
65+
66+
# Generated docs-site artifacts.
67+
docs-site/node_modules/
68+
docs-site/dist/
69+
docs-site/.astro/
6570
# macOS Finder metadata.
6671
.DS_Store
6772

0 commit comments

Comments
 (0)