build: 修改配置 #17
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: [16.x] | |
steps: | |
# 使用的动作。格式:userName/repoName。作用:检出仓库,获取源码。 官方actions库:https://github.com/actions | |
- name: Checkout | |
uses: actions/checkout@master | |
# 指定 nodejs 版本 | |
- name: Use Nodejs ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
# 部署 | |
- name: Deploy | |
env: # 设置环境变量 | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
GITEE_TOKEN: ${{ secrets.GITEE_TOKEN }} | |
run: npm install && npm run deploy |