Skip to content

Commit 5d483c4

Browse files
authored
Merge pull request #75 from thisisobate/fix/72-patch1
chore: fix gh pages to serve correct page
2 parents 6d47340 + f45f4d5 commit 5d483c4

1 file changed

Lines changed: 42 additions & 18 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,56 @@
1-
name: Deploy Docusaurus to GitHub Pages
1+
name: Deploy to GitHub Pages
2+
3+
defaults:
4+
run:
5+
shell: bash
6+
working-directory: ./website
27

38
on:
49
push:
510
branches:
6-
- main # Change to your default branch
11+
- main
12+
# Review gh actions docs if you want to further define triggers, paths, etc
13+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
714

815
jobs:
9-
deploy:
16+
build:
17+
name: Build Docusaurus
1018
runs-on: ubuntu-latest
1119
steps:
12-
- name: Checkout repository
13-
uses: actions/checkout@v3
14-
15-
- name: Set up Node.js
16-
uses: actions/setup-node@v3
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- uses: actions/setup-node@v4
1724
with:
18-
node-version: 20 # Use the Node.js version specified in your project
25+
node-version: 20
26+
cache: npm
1927

2028
- name: Install dependencies
21-
run: npm install
22-
working-directory: ./website # Change to your subfolder
23-
24-
- name: Build Docusaurus
29+
run: npm ci
30+
- name: Build website
2531
run: npm run build
26-
working-directory: ./website # Change to your subfolder
2732

28-
- name: Deploy to GitHub Pages
29-
uses: peaceiris/actions-gh-pages@v3
33+
- name: Upload Build Artifact
34+
uses: actions/upload-pages-artifact@v3
3035
with:
31-
github_token: ${{ secrets.GITHUB_TOKEN }}
32-
publish_dir: ./website/build # Path to the build folder
36+
path: build
37+
38+
deploy:
39+
name: Deploy to GitHub Pages
40+
needs: build
41+
42+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
43+
permissions:
44+
pages: write # to deploy to Pages
45+
id-token: write # to verify the deployment originates from an appropriate source
46+
47+
# Deploy to the github-pages environment
48+
environment:
49+
name: github-pages
50+
url: ${{ steps.deployment.outputs.page_url }}
51+
52+
runs-on: ubuntu-latest
53+
steps:
54+
- name: Deploy to GitHub Pages
55+
id: deployment
56+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)