File tree Expand file tree Collapse file tree 2 files changed +56
-4
lines changed Expand file tree Collapse file tree 2 files changed +56
-4
lines changed Original file line number Diff line number Diff line change 1+ name : Docs
2+
3+ on :
4+ push :
5+
6+ jobs :
7+ build :
8+ runs-on : ubuntu-latest
9+ permissions :
10+ contents : read
11+ steps :
12+ - uses : actions/checkout@v4
13+ with :
14+ fetch-depth : 0
15+ - uses : actions/setup-node@v4
16+ with :
17+ node-version : 20
18+ cache : npm
19+ - uses : actions/configure-pages@v3
20+ id : pages
21+ - name : Install dependencies
22+ run : npm install
23+ - name : Build
24+ env :
25+ GITHUB_PAGES_BASE : " ${{ steps.pages.outputs.base_url }}"
26+ run : npm run docs:build
27+ - name : Upload artifact
28+ uses : actions/upload-pages-artifact@v3
29+ with :
30+ path : .vuepress/dist/
31+
32+ deploy :
33+ if : github.ref == 'refs/heads/master'
34+ needs : build
35+ permissions :
36+ pages : write
37+ id-token : write
38+ environment :
39+ name : github-pages
40+ url : ${{ steps.deployment.outputs.page_url }}
41+ runs-on : ubuntu-latest
42+ concurrency :
43+ group : deploy
44+ cancel-in-progress : true
45+ steps :
46+ - name : Deploy to GitHub Pages
47+ id : deployment
48+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change 11import { viteBundler } from '@vuepress/bundler-vite'
22import { defaultTheme } from '@vuepress/theme-default'
33import { defineUserConfig } from 'vuepress'
4+ import { env } from 'node:process' ;
45
5- export default defineUserConfig ( {
6+ const options = {
67 title : "MetaCPAN infra" ,
78 description : "MetaCPAN infrastructure and networking" ,
89 bundler : viteBundler ( ) ,
@@ -32,7 +33,10 @@ export default defineUserConfig({
3233 // }
3334 // ]
3435 ]
35- } )
36-
37- export {
3836} ;
37+
38+ if ( env . GITHUB_PAGES_BASE ) {
39+ options . base = env . GITHUB_PAGES_BASE . replace ( / ^ \/ ? / , '/' ) . replace ( / \/ ? $ / , '/' ) ;
40+ }
41+
42+ export default defineUserConfig ( options ) ;
You can’t perform that action at this time.
0 commit comments