Skip to content

Commit

Permalink
ci: add deploy ghpages support
Browse files Browse the repository at this point in the history
  • Loading branch information
Carrotzpc committed Jul 29, 2024
1 parent b8d49fe commit f2de37a
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/deploy-ghpages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Deploy to GitHub Pages

on:
# https://docs.github.com/zh/actions/using-workflows/events-that-trigger-workflows#workflow_run
workflow_run:
workflows:
- 'Build and Release'
types:
- completed
jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js v20.x
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install pnpm v9.x
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install deps
run: pnpm install

- name: Build website
run: npm run docs:build

# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GH_TOKEN }}
publish_dir: ./example/dist/dumi-theme-yunti
3 changes: 3 additions & 0 deletions example/.dumirc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ export default defineConfig({
define: {
'process.env': process.env,
},
base: isProduction ? '/dumi-theme-yunti/' : '/',
publicPath: '/dumi-theme-yunti/',
outputPath: './dist/dumi-theme-yunti/',
favicons: ['https://avatars.githubusercontent.com/u/148947838?s=64&v=4'],
locales: [
{ id: 'zh-CN', name: '中文', suffix: '' },
Expand Down

0 comments on commit f2de37a

Please sign in to comment.