This Action will Build your Vue Project and deploy it to Github Pages
-
You should have a
vite.config.jsor avite.config.tsfile at the root of your directory. Create one if you don't. -
Add this to you
vite.config.jsorvite.config.ts(and rename "YourRepoName" to your repo name)
export default defineConfig({
... // Already existing configurations
base: '/YourRepoName/'
});- Create a Github Actions Workflow file and add this to it (and replace "YourGithubName" and "YourRepoName" with the names)
name: Build Vue
on: [push]
jobs:
build_vue:
runs-on: ubuntu-latest
name: Build Vue
steps:
- uses: actions/checkout@v3
- id: Build-Vue
uses: nvkomata/VuePagesAction@1.1
with:
username: 'YourGithubName'
reponame: 'YourRepoName'
token: ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged- Go to Settings -> Scroll down to GitHub Pages -> Select
gh-pagesas branch and/as directory
| Name | Description | Default | Required |
|---|---|---|---|
| username | Your username | - | β |
| reponame | Your repository name | - | β |
| token | Please leave this line unchanged | - | β |
| gitemail | Git commit email | CI@example.com | β |
| gitname | Git commit name | CI | β |
| gitmsg | Git commit message | deploy | β |
| cname | Custom domain | - | β |
| usepnpm | Use pnpm to build | true | β |