github action是使用yaml文件来做到CI/CD的,文件位置存放在 .github/workflows,yaml文件内容如下:
name: ncatest.cx.js
on:
push:
branches:
- main
schedule:
- cron: '0 5 * * *' #国际标准时间,北京时间+8,即下午1点钟
jobs:
run-csjs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main #采用main分支下的
- name: Setup Node.js
uses: actions/setup-node@v2 #安装node.js
with:
node-version: '14'
- name: Install Dependency
run: |
npm install
npm install got
npm install tough-cookie
node ./scripts/cx.js #脚本存在根目录scripts文件夹下