You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| `string` | `/{your-repo-name}` OR `/` if you have CNAME | `/my-vite-project` |
130
130
131
131
132
-
[Public base path](https://vitejs.dev/guide/build.html#public-base-path) string for Vite, this affects the routing, history and asset links. Make sure to provide appropriately since Github Pages stores your app in a directory under a subdomain. If you plan on deploying to alternative platform such as Vercel, you should simply provide `/`.
132
+
[Public base path](https://vitejs.dev/guide/build.html#public-base-path) string for Vite, this affects the routing, history and asset links. Make sure to provide appropriately since GitHub Pages stores your app in a directory under a subdomain. If you plan on deploying to alternative platform such as Vercel, you should simply provide `/`.
133
133
134
134
Under normal circumstances, you don't need to provide/override this parameter, action will set it to your repo name appropriately.
135
135
136
+
#### Here's how `public_base_path` is resolved:
137
+
138
+
- If `public_base_path` parameter/input is provided, it will be used regardless.
139
+
- If `public_base_path` parameter/input is **NOT** provided:
140
+
- If the repository root has `CNAME` file for GitHub Pages Custom Domain setup, then `public_base_path` default value will resolve to `/`
141
+
- If the repository root does **NOT** have `CNAME`, `public_base_path` default value will resolve to `/{your-repo-name}`
142
+
143
+
<a name="public-base-path-ack"></a>
144
+
#### Acknowledgement
145
+
146
+
See the suggestion for the CNAME expansion [here](https://github.com/skywarth/vite-github-pages-deployer/issues/5)
147
+
148
+
Grateful to the [Greg Sadetsky](https://github.com/gregsadetsky) for his proposition on alternating default value of this input. Also, thankful for his collaboration on explaining GitHub pages custom domain setting and testing phase of these changes.
Copy file name to clipboardExpand all lines: action.yml
+19-3Lines changed: 19 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,8 @@ inputs:
9
9
public_base_path:
10
10
description: "Public base path string for vite, this affects the routing, history and asset links. Make sure to provide appropriately since Github Pages stores your app in a directory under a subdomain."
11
11
required: false
12
-
default: "/${{ github.event.repository.name }}"
12
+
#default: "/${{ github.event.repository.name }}" //Vanilla default value. Altered down the steps in regard for https://github.com/skywarth/vite-github-pages-deployer/issues/5
13
+
default: ''
13
14
build_path:
14
15
description: "Which folder do you want your Github Page to use as root directory. Usually it is your build output directory such as ./dist "
0 commit comments