-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (41 loc) · 1.2 KB
/
update_contests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Update contests data
on:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:
jobs:
update-data:
name: run update_contests.py
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- name: Install conda environment
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: tru-env
environment-file: environment.yml
python-version: 3.9.4
- name: update contests json
shell: bash -l {0}
run: |
conda activate tru-env
python3 update_contests.py
- name: Commit contests json
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
if [[ `git status --porcelain` ]]; then
git add data/contests.json
git commit -m "update contests.json" -a
else
echo "No significant changes"
fi
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}