chore: 🔖 publish #84
This file contains hidden or 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 | |
on: | |
push: | |
branches: | |
- master | |
- v* | |
paths: | |
- packages/** | |
- docs/** | |
- typings/** | |
- .umirc.js | |
- tsconfig.json | |
- package.json | |
- .github/workflows/* | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
# 添加全局权限配置[1,7](@ref) | |
permissions: | |
contents: write # 关键:授予仓库写入权限 | |
pages: write | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly. | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
- name: Install | |
run: npm install | |
- name: Build docs | |
run: npm run build | |
- name: Deploy docs | |
uses: JamesIves/[email protected] # 升级至最新版[2,7](@ref) | |
with: | |
branch: gh-pages | |
folder: site | |
target-folder: ${{github.ref_name}} |