[fix] CI修改token #104
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: CI | |
on: | |
push: | |
branches: [ "main" ] | |
permissions: | |
contents: write | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# 拉取代码 | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v3 | |
with: | |
# 拉取commit的深度,默认1,0表示拉取所有commit,会降低速度 | |
fetch-depth: 0 | |
# 安装NPM | |
- name: Install Dependencies 📦 | |
# uses: Jaid/action-npm-install@v1.2.4 | |
run: npm ci # clean install | |
# 生成静态文件 | |
- name: Build 🏗️ | |
run: npm run build | |
# 部署到 GitHub Pages | |
- name: Deploy 🚀 | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: docs/.vuepress/dist # vuepress 生成的静态文件存放的地方 | |
token: ${{ secrets.ACCESS_TOKEN }} # secret | |
branch: gh-pages # 部署到 gh-pages 分支,因为 main 分支存放的一般是源码,而 gh-pages 分支则用来存放生成的静态文件 |