2022-04-11 16:51:22 +08:00
|
|
|
|
name: CI
|
|
|
|
|
|
|
|
|
|
# 在master分支发生push事件时触发。
|
|
|
|
|
on:
|
|
|
|
|
push:
|
|
|
|
|
branches:
|
|
|
|
|
- master
|
|
|
|
|
|
|
|
|
|
env: # 设置环境变量
|
|
|
|
|
TZ: Asia/Shanghai # 时区(设置时区可使页面中的`最近更新时间`使用时区时间)
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
build: # 自定义名称
|
|
|
|
|
runs-on: ubuntu-latest # 运行在虚拟机环境ubuntu-latest
|
|
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
|
matrix:
|
2023-08-18 20:37:16 +08:00
|
|
|
|
node-version: [16.x]
|
2022-04-11 16:51:22 +08:00
|
|
|
|
|
|
|
|
|
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
|