设置仓库的公钥和私钥
生成命令vue
ssh-keygen -t rsa -C youremail@example.com
name: blog deploy on: push: branches: - master jobs: build-deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - run: npm ci - run: npm install vuepress - run: npm run build - run: cp CNAME docs/.vuepress/dist/ - name: Deploy uses: peaceiris/actions-gh-pages@v2.5.0 env: ACTIONS_DEPLOY_KEY: ${{secrets.key}} PUBLISH_BRANCH: gh-pages PUBLISH_DIR: docs/.vuepress/dist
当你在本地更新完博客,直接提交并推送到Github项目,Actions就会在云端自动打包并部署到gh-pages分支,就能够直接用 github用户名.github.io/项目名 的方式访问了。git
个人博客项目地址: https://github.com/shanghaobo/qinyu-blog
个人博客地址: https://qinyushop.com/