設置倉庫的公鑰和私鑰
生成命令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/