Skip to content

Nightly Data Update #204

Nightly Data Update

Nightly Data Update #204

Workflow file for this run

name: 'Nightly Data Update'
on:
workflow_dispatch:
schedule:
- cron: '00 9 * * *' # once a day at 9:00 AM UTC / 4:00 AM EST
jobs:
# A helpful guide on installing poetry in Github Actions can be found here:
# https://jacobian.org/til/github-actions-poetry/
set_up_environment:
name: Set up environment
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./util
steps:
- name: Check out default branch
uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
# Ensure the correct version of python is installed.
- uses: actions/[email protected]
with:
python-version: '3.10'
cache: 'poetry'
- name: Python Version Test
run: python3 --version
# Install dependencies. `--no-root` means "install all dependencies but not the project
# itself", which is what you want to avoid caching _your_ code. The `if` statement
# ensures this only runs on a cache miss.
- run: poetry install --no-interaction --no-root
if: steps.cache-deps.outputs.cache-hit != 'true'
# Load all the blue banners that have been won since the current year.
load_blue_banners:
name: Load Blue Banners
needs: set_up_environment
runs-on: ubuntu-latest
timeout-minutes: 30
defaults:
run:
working-directory: ./util
steps:
- name: Check out default branch
uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
# Load the cached poetry install from the environment set up step.
- uses: actions/[email protected]
with:
python-version: '3.10'
cache: 'poetry'
# Install dependencies. `--no-root` means "install all dependencies but not the project
# itself", which is what you want to avoid caching _your_ code. The `if` statement
# ensures this only runs on a cache miss.
- run: poetry install --no-interaction --no-root
if: steps.cache-deps.outputs.cache-hit != 'true'
- name: Update blue banner data
run: poetry run python main.py banner --banner_mode=since_current_year --credentials=${{ secrets.DATA_UPDATE_CREDENTIALS }}
# Load all the events and update their data.
load_event_data:
name: Load Event Data
needs: [set_up_environment, load_blue_banners]
runs-on: ubuntu-latest
timeout-minutes: 30
defaults:
run:
working-directory: ./util
steps:
- name: Check out default branch
uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
# Load the cached poetry install from the environment set up step.
- uses: actions/[email protected]
with:
python-version: '3.10'
cache: 'poetry'
# Install dependencies. `--no-root` means "install all dependencies but not the project
# itself", which is what you want to avoid caching _your_ code. The `if` statement
# ensures this only runs on a cache miss.
- run: poetry install --no-interaction --no-root
if: steps.cache-deps.outputs.cache-hit != 'true'
- name: Update event data
run: poetry run python main.py event --event_mode=since_current_year --credentials=${{ secrets.DATA_UPDATE_CREDENTIALS }}
# Refresh the team information in case it has changed. Also update the team data.
load_team_data:
name: Load Team Data
needs: [set_up_environment, load_blue_banners]
runs-on: ubuntu-latest
timeout-minutes: 30
defaults:
run:
working-directory: ./util
steps:
- name: Check out default branch
uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
# Load the cached poetry install from the environment set up step.
- uses: actions/[email protected]
with:
python-version: '3.10'
cache: 'poetry'
# Install dependencies. `--no-root` means "install all dependencies but not the project
# itself", which is what you want to avoid caching _your_ code. The `if` statement
# ensures this only runs on a cache miss.
- run: poetry install --no-interaction --no-root
if: steps.cache-deps.outputs.cache-hit != 'true'
- name: Update team data
run: poetry run python main.py team --team_mode=full --credentials=${{ secrets.DATA_UPDATE_CREDENTIALS }}