deploy.sh 538 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env sh
  2. # 确保脚本抛出遇到的错误
  3. set -e
  4. # 生成静态文件
  5. npm run docs:build
  6. # 进入生成的文件夹
  7. cd docs/.vitepress/dist
  8. touch .nojekyll
  9. # 如果是发布到自定义域名
  10. # echo 'www.example.com' > CNAME
  11. git init
  12. git add -A
  13. git commit -m 'deploy'
  14. # 如果发布到 https://<USERNAME>.github.io
  15. git push -f git@github.com:xiaoxian521/xiaoxian521.github.io.git master:main
  16. # 如果发布到 https://<USERNAME>.github.io/<REPO>
  17. # git push -f git@github.com:<USERNAME>/<REPO>.git master:gh-pages
  18. cd -