File tree Expand file tree Collapse file tree 3 files changed +8
-14
lines changed
Expand file tree Collapse file tree 3 files changed +8
-14
lines changed Original file line number Diff line number Diff line change 1- # Sample workflow for building and deploying a VitePress site to GitHub Pages
2- #
1+
32name : Deploy VitePress site to Pages
43
54on :
6- # Runs on pushes targeting the `main` branch. Change this to `master` if you're
7- # using the `master` branch as the default branch.
85 push :
96 branches : [gh-pages]
107
118 # Allows you to run this workflow manually from the Actions tab
129 workflow_dispatch :
1310
14- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1511permissions :
1612 contents : read
1713 pages : write
1814 id-token : write
1915
20- # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
21- # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
2216concurrency :
2317 group : pages
2418 cancel-in-progress : false
2519
2620jobs :
27- # Build job
2821 build :
2922 runs-on : ubuntu-latest
3023 steps :
3124 - name : Checkout
3225 uses : actions/checkout@v5
33- with :
34- fetch-depth : 0 # Not needed if lastUpdated is not enabled
3526
3627 - name : Setup PHP
3728 uses : shivammathur/setup-php@v2
@@ -64,13 +55,14 @@ jobs:
6455
6556 - name : Build with VitePress
6657 run : pnpm docs:build
58+ env :
59+ REPOSITORY : ${{ github.repository }}
6760
6861 - name : Upload artifact
6962 uses : actions/upload-pages-artifact@v3
7063 with :
7164 path : docs/.vitepress/dist
7265
73- # Deployment job
7466 deploy :
7567 environment :
7668 name : github-pages
Original file line number Diff line number Diff line change @@ -6,11 +6,13 @@ import { compileCode, addSandboxButton } from './plugins';
66import { fileURLToPath } from 'node:url' ;
77import tailwindcss from '@tailwindcss/vite' ;
88
9+ const env = ( globals || window ) ?. process ?. env ?. REPOSITORY ;
10+
911// https://vitepress.dev/reference/site-config
1012const vitePressOptions : UserConfig = {
1113 title : 'Carbon' ,
1214 description : 'A simple PHP API extension for DateTime.' ,
13- base : ' /',
15+ base : env === 'briannesbitt/Carbon' ? '/' : '/carbon /',
1416 head : [
1517 [
1618 'link' , {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ The documentation resides in the [gh-pages branch of Carbon](https://github.com/
1010* ` git clone `
1111* ` git checkout gh-pages `
1212* ` git checkout -b [speaking-new-branch-name] `
13- * Modify ` .src.html ` source files
13+ * Modify ` .md ` source files
1414* ` git commit `
1515* ` git push `
1616* Create a pull request against the ** gh-pages** branch
@@ -72,4 +72,4 @@ Bootstrap icons are used in the documentation. You can find the list of availabl
7272Replace ` icon-name ` with the desired icon's name from the Bootstrap Icons library. For example, to add a star icon, you would use:
7373``` html
7474<i class =" bi bi-star" ></i >
75- ```
75+ ```
You can’t perform that action at this time.
0 commit comments