Skip to content

Commit f500a71

Browse files
committed
ci(docs): Add workflows for deploying to Github Pages
1 parent 8a2c948 commit f500a71

2 files changed

Lines changed: 93 additions & 0 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+
3+
name: Deploy docs to Github Pages
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
paths:
10+
- 'docs/**'
11+
12+
defaults:
13+
run:
14+
working-directory: docs/
15+
16+
jobs:
17+
build:
18+
name: Build Docusaurus
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: lts/*
29+
cache: npm
30+
31+
- name: Install dependencies
32+
run: npm ci
33+
34+
- name: Build website
35+
run: npm run build
36+
37+
- name: Upload Build Artifact
38+
uses: actions/upload-pages-artifact@v3
39+
with:
40+
path: build
41+
42+
deploy:
43+
name: Deploy to GitHub Pages
44+
needs: build
45+
46+
permissions:
47+
pages: write
48+
id-token: write
49+
50+
environment:
51+
name: github-pages
52+
url: ${{ steps.deployment.outputs.page_url }}
53+
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: Deploy to GitHub Pages
57+
id: deployment
58+
uses: actions/deploy-pages@v4

.github/workflows/test-docs.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+
3+
name: Test docs
4+
5+
on:
6+
pull_request:
7+
branches:
8+
- main
9+
paths:
10+
- 'docs/**'
11+
12+
defaults:
13+
run:
14+
working-directory: ./docs/
15+
16+
jobs:
17+
build:
18+
name: Build Docusaurus
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: lts/*
29+
cache: npm
30+
31+
- name: Install dependencies
32+
run: npm ci
33+
34+
- name: Build website
35+
run: npm run build

0 commit comments

Comments
 (0)