This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GitHub Actions Build and Deploy Demo | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v2 # 如果您使用的是Actions/checkout@v2,那么在大多数情况下,您必须将Persistent-Credentials设置为false,这样部署才能正常工作。 | |
with: | |
persist-credentials: false | |
# 生成静态文件 | |
- name: Build | |
run: yarn install && yarn run gitBuild | |
- name: Deploy 🚀 | |
uses: JamesIves/github-pages-deploy-action@releases/v3 | |
with: | |
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} #secrets.ACCESS_TOKEN是项目配置的密钥 | |
BRANCH: gh-pages # 操作应部署到的分支。 | |
FOLDER: dist # 操作应部署的文件夹。 |