fix: update #269
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 | |
# 在master分支发生push事件时触发。 | |
on: | |
push: | |
branches: | |
- master | |
env: # 设置环境变量 | |
TZ: Asia/Shanghai # 时区(设置时区可使页面中的`最近更新时间`使用时区时间) | |
jobs: | |
build: # 自定义名称 | |
runs-on: ubuntu-latest # 运行在虚拟机环境ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [14.x] | |
steps: | |
- name: Checkout # 步骤1 | |
uses: actions/checkout@v1 # 使用的动作。格式:userName/repoName。作用:检出仓库,获取源码。 官方actions库:https://github.com/actions | |
- name: Use Node.js ${{ matrix.node-version }} # 步骤2 | |
uses: actions/setup-node@v1 # 作用:安装nodejs | |
with: | |
node-version: ${{ matrix.node-version }} # 版本 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 7 | |
run_install: true | |
- name: run deploy.sh # 步骤3 | |
env: # 设置环境变量 | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} # toKen私密变量 | |
CODING_TOKEN: ${{ secrets.CODING_TOKEN }} | |
run: pnpm install && pnpm run deploy | |
# - name: Build and Deploy # 步骤3 (只提交到github可以使用这个步骤) | |
# uses: JamesIves/github-pages-deploy-action@master # 作用:将项目构建和部署到github。 https://github.com/JamesIves/github-pages-deploy-action | |
# env: # 设置环境变量 | |
# ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} # toKen私密变量 | |
# BASE_BRANCH: master # 要部署的文件夹所在的分支. | |
# BRANCH: gh-pages # 部署到的分支 | |
# FOLDER: docs/.vuepress/dist # 要部署的文件夹. | |
# BUILD_SCRIPT: pnpm install && pnpm run build && cd docs/.vuepress/dist && echo 'blog.shenzjd.com' > CNAME && cd - # 部署前要执行的命令(记得cd进入某个目录后,后面要cd -退回开始的目录) |