Skip to content

Commit bafe64c

Browse files
committed
feat: enable github pages
Signed-off-by: bjwswang <[email protected]>
1 parent 9a503a2 commit bafe64c

File tree

4 files changed

+9122
-5
lines changed

4 files changed

+9122
-5
lines changed

.github/workflows/deploy.yaml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
# Review gh actions docs if you want to further define triggers, paths, etc
8+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
9+
10+
jobs:
11+
deploy:
12+
name: Deploy to GitHub Pages
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: actions/setup-node@v3
19+
with:
20+
node-version: 18
21+
cache: npm
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
- name: Build website
26+
run: npm run build
27+
28+
# Popular action to deploy to GitHub Pages:
29+
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
30+
- name: Deploy to GitHub Pages
31+
uses: peaceiris/actions-gh-pages@v3
32+
with:
33+
github_token: ${{ secrets.GITHUB_TOKEN }}
34+
publish_dir: ./build

.github/workflows/test-deploy.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Test deployment
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
# Review gh actions docs if you want to further define triggers, paths, etc
8+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
9+
10+
jobs:
11+
test-deploy:
12+
name: Test deployment
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-node@v3
17+
with:
18+
node-version: 18
19+
cache: npm
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
- name: Test build website
24+
run: npm run build

docusaurus.config.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,18 @@ const config = {
1111
favicon: 'img/favicon.ico',
1212

1313
// Set the production url of your site here
14-
url: 'https://bestchains.fun',
14+
url: 'https://bestchains.github.io',
1515
// Set the /<baseUrl>/ pathname under which your site is served
1616
// For GitHub pages deployment, it is often '/<projectName>/'
17-
baseUrl: '/',
17+
baseUrl: '/website/',
1818

1919
// GitHub pages deployment config.
2020
// If you aren't using GitHub pages, you don't need these.
2121
organizationName: 'bestchains', // Usually your GitHub org/user name.
22-
projectName: 'bestchains', // Usually your repo name.
22+
projectName: 'website', // Usually your repo name.
23+
24+
deploymentBranch: 'gh-pages',
25+
trailingSlash: false,
2326

2427
onBrokenLinks: 'throw',
2528
onBrokenMarkdownLinks: 'warn',

0 commit comments

Comments
 (0)