Update contests data #1684
This file contains hidden or 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: 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 }} |