Skip to content

Commit 10fda0d

Browse files
committed
Sets up Docusaurus deployment to GitHub Pages
Configures a new GitHub Actions workflow to automatically build and deploy the Docusaurus site to GitHub Pages. This includes setting up Node.js, installing dependencies, building the site, and deploying the generated content. Also updates package and tsconfig files with updated configurations.
1 parent a2144e4 commit 10fda0d

File tree

3 files changed

+43
-13
lines changed

3 files changed

+43
-13
lines changed

.github/workflows/deploy.yml

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,48 @@
1-
name: Deploy to GitHub Pages
1+
name: Deploy Docusaurus to GitHub Pages
22

33
on:
44
push:
5-
branches: [gh-pages]
5+
branches: [gh-pages] # or your default branch
6+
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
concurrency:
13+
group: "pages"
14+
cancel-in-progress: true
615

716
jobs:
8-
deploy:
9-
environment:
10-
name: github-pages
11-
url: ${{ steps.deployment.outputs.page_url }}
17+
build:
1218
runs-on: ubuntu-latest
1319
steps:
14-
- name: Checkout gh-pages branch
20+
- name: Checkout code
1521
uses: actions/checkout@v4
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
1625
with:
17-
ref: gh-pages
26+
node-version: 24
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Build Docusaurus site
32+
run: npm run build
1833

34+
- name: Upload build output
35+
uses: actions/upload-pages-artifact@v3
36+
with:
37+
path: ./build
38+
39+
deploy:
40+
needs: build
41+
runs-on: ubuntu-latest
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
steps:
1946
- name: Deploy to GitHub Pages
2047
id: deployment
2148
uses: actions/deploy-pages@v4

package-lock.json

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
// This file is not used in compilation. It is here just for a nice editor experience.
33
"extends": "@docusaurus/tsconfig",
44
"compilerOptions": {
5-
"baseUrl": "."
5+
"baseUrl": ".",
6+
"forceConsistentCasingInFileNames": true,
7+
"strict": true
68
},
79
"exclude": [".docusaurus", "build"]
810
}

0 commit comments

Comments
 (0)