(技術)透過Github-Action實現CICD-Pipeline
How to use
git clone
1
https://github.com/chienniman/mantine-vite-template.git
download the ZIP
fork the project
Create a new repository
Create CI/CD workflow
.github /workflows/main.yml
1 | name: Deploy to gh-page |
Local development and usage
install yarn
1 | yarn --version |
1 | npm install --global yarn |
install node_modules
1 | yarn install |
add homepage to package.json
1 | "homepage": "https://<githubusername>.github.io/<app>" |
Start the vite server and develop new features.
1 | npm run dev |
test
1 | npm run test |
Commit to master branch
1 | git init |
Enable GitHub Pages
Done
Discussion
Assets links
To fix the issue of resource loading 404 errors
and modify the default path, you can achieve it through the configuration in vite.config.ts.
vite.config.ts
1 | import { defineConfig } from 'vite'; |
Pages build and deployment
I think there’s a lot of scope for confusion for users of this action, when pages build and deployment will also be running on every push and pushing pages assets.
I think it’s impossible to really say right now what that looks like until GitHub announces what these actions intend to do in the long run. As the post suggests this is a necessary step that occurs after the push gets made, this was already occurring behind the scenes it just wasn’t made visible.
Ref
yarn
What is actions/checkout@v2 in Github action
deploy-to-github-pages
vite-deploy-demo
antonputra/tutorials
github-pages-deploy-action