Skip to content

Commit ecd0720

Browse files
committed
chore: update deployment workflow for GitHub Pages
1 parent d47fa7d commit ecd0720

File tree

2 files changed

+31
-20
lines changed

2 files changed

+31
-20
lines changed

.github/workflows/deploy.yml

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,44 @@ on:
1010
workflow_dispatch:
1111

1212
jobs:
13-
build-and-deploy:
14-
name: Build and Deploy
13+
build:
14+
name: Build Docusaurus
1515
runs-on: ubuntu-latest
1616
steps:
17-
- name: Checkout Repository
18-
uses: actions/checkout@v6
17+
- uses: actions/checkout@v6
1918
with:
2019
fetch-depth: 0
21-
22-
- name: Setup Node.js
23-
uses: actions/setup-node@v6
20+
- uses: actions/setup-node@v6
2421
with:
2522
node-version: 22
2623
cache: npm
2724

2825
- name: Install dependencies
2926
run: npm ci
30-
3127
- name: Build website
3228
run: npm run build
3329

34-
- name: Deploy to Server via rsync
35-
uses: easingthemes/[email protected]
30+
- name: Upload Build Artifact
31+
uses: actions/upload-pages-artifact@v3
3632
with:
37-
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
38-
REMOTE_HOST: ${{ secrets.SSH_HOST }}
39-
REMOTE_USER: ${{ secrets.SSH_USER }}
40-
REMOTE_PORT: ${{ secrets.SSH_PORT }}
41-
SOURCE: "build/"
42-
TARGET: ${{ secrets.TARGET_DIR }}
43-
ARGS: "-avz --delete"
33+
path: build
34+
35+
deploy:
36+
name: Deploy to GitHub Pages
37+
needs: build
38+
39+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
40+
permissions:
41+
pages: write # to deploy to Pages
42+
id-token: write # to verify the deployment originates from an appropriate source
43+
44+
# Deploy to the github-pages environment
45+
environment:
46+
name: github-pages
47+
url: ${{ steps.deployment.outputs.page_url }}
48+
49+
runs-on: ubuntu-latest
50+
steps:
51+
- name: Deploy to GitHub Pages
52+
id: deployment
53+
uses: actions/deploy-pages@v4

docusaurus.config.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ const config = {
2020
},
2121

2222
// Set the production url of your site here
23-
url: "https://docs.waveshare.com",
24-
// Set the /<baseUrl>/ pathname under which your site is served
25-
// For GitHub pages deployment, it is often '/<projectName>/'
23+
url: "https://waveshareteam.github.io",
2624
baseUrl: "/",
25+
projectName: 'Docs_en',
26+
organizationName: 'waveshareteam',
27+
trailingSlash: false,
2728

2829
onBrokenLinks: "throw",
2930

0 commit comments

Comments
 (0)