Skip to content

Commit

Permalink
Update deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinTTY committed Aug 17, 2024
1 parent 3d689c8 commit 553a17d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 13 deletions.
41 changes: 28 additions & 13 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,45 @@ on:
- main

jobs:
deploy:
name: Deploy to GitHub Pages
build:
name: Build Docusaurus
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docs/
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
with:
node-version: 16.x
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
cache-dependency-path: ./docs/

- name: Install dependencies
run: npm ci
- name: Build website
run: npm run build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: docs
publish_dir: ./docs/docusaurus/build
user_name: RobinTTY
user_email: [email protected]
path: build

deploy:
name: Deploy to GitHub Pages
needs: build

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 2 additions & 0 deletions docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ const config: Config = {
baseUrl: `/${projectName}/`,
organizationName: "RobinTTY",
projectName: projectName,
deploymentBranch: "docs",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
trailingSlash: false,

i18n: {
defaultLocale: "en",
Expand Down

0 comments on commit 553a17d

Please sign in to comment.