mirror of https://github.com/dunwu/db-tutorial.git
37 lines
999 B
YAML
37 lines
999 B
YAML
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:
|
||
# 使用的动作。格式: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
|