umi plugin to publish to Github Pages.
Configure in .umirc.js
,
export default {
ghPages:{
dir:'dist',
useCDN: false,
getCDNUrl:(gitInfo)=>{return 'url'}
...gh-pages#PublishOptions
}
}
exclude dir
(default umi config outputPath
), other options please checkout https://github.com/tschaub/gh-pages#options
use CDN in publicPath ,default use jsdelivr - A free CDN for Open Source.
Custom CDN url.
config/config.ts
{
ghPages: {
useCDN: true,
},
}
umi build
or
$GH_PAGES_USE_CDN=true umi build
Deploy in vercel (now)
config/config.ts
{
ghPages: {
branch: 'gh-pages',
silent: true,
repo: `https://${process.env.GH_TOKEN}@github.com/alitajs/alita-docs.git`,
},
}
set the environment variables in vercel, with Production.
GH_TOKEN=[tokens](
https://github.com/settings/tokens)
GH_PAGES_USE_CDN=true
run the command
$ umi build
- https://github.com/sorrycc/test-gh-pages
- https://sorrycc.github.io/test-gh-pages/
- https://github.com/alitajs/alita-docs
MIT