Skip to content

Commit

Permalink
ci: add web deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
mcoo committed Apr 30, 2023
1 parent 97adb17 commit 3c4ca52
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deploy
on:
workflow_dispatch: {}
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
cache-dependency-path: "web/package.json"
- run: npm install yarn -g
- name: Build
run: |
cd web
yarn install
yarn docs:build
- uses: actions/configure-pages@v2
- uses: actions/upload-pages-artifact@v1
with:
path: web/docs/.vitepress/dist
- name: Deploy
id: deployment
uses: actions/deploy-pages@v1
4 changes: 2 additions & 2 deletions web/docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ export default defineConfig({
pattern: ({ relativePath }) => {
// @ts-ignore
if (relativePath.startsWith('packages/')) {
return `hhttps://github.com/opq-osc/Yui/main/web/${relativePath}`
return `hhttps://github.com/opq-osc/Yui/tree/main/web/${relativePath}`
} else {
return `https://github.com/opq-osc/Yui/main/web/docs/${relativePath}`
return `https://github.com/opq-osc/Yui/tree/main/web/docs/${relativePath}`
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:serve": "vitepress serve docs"
},
"compilerOptions": {
"lib": ["ES2021", "dom"]
}
}

0 comments on commit 3c4ca52

Please sign in to comment.