generate data automatically #32299
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: generate data automatically | |
on: | |
# push: | |
# Run workflow automatically | |
schedule: | |
# Runs every hour | |
# 每个小时 10 分执行,目的是为了和其他 crob 岔开时间,避免脚本执行一半其他 cron 推送了 origin 报错(报错:你需要先 git pull)。 | |
- cron: "10 * * * *" | |
jobs: | |
generate: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.CHECKOUT }} | |
submodules: "true" | |
- name: run npm | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "14" | |
- run: npm install | |
- name: generate data | |
env: | |
secret: ${{secrets.GENERATE}} | |
run: npm run generate | |
- name: Commit static | |
run: | | |
source ./scripts/commit.sh | |
- name: generate lectures | |
env: | |
secret: ${{secrets.GENERATE}} | |
run: npm run lecture | |
- name: Commit static | |
run: | | |
source ./scripts/commit.sh |