Update Course Data #158
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: Update Course Data | |
on: | |
schedule: | |
- cron: '0 2 * * *' | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
update-data: | |
# Adapted from https://github.com/StoDevX/AAO-React-Native/blob/master/.github/workflows/cocoapods.yml | |
name: Course Data Update | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
strategy: | |
matrix: | |
python-version: ["3.7"] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.COURSE_DATA_TOOLS_GH_PUSH_TOKEN }} | |
- name: Start check-in | |
if: github.event_name == 'schedule' | |
run: bash bin/monitor.sh start | |
env: | |
SENTRY_DSN: ${{ secrets.COURSE_DATA_TOOLS_GH_SENTRY_DSN }} | |
TARGET_ENV: 'production' | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: push-on-course-data-change | |
run: bash bin/github.sh | |
env: | |
GITHUB_BRANCH: ${{ github.ref_name }} | |
head_ref: ${{ github.ref }} | |
GITHUB_OAUTH: ${{ secrets.COURSE_DATA_TOOLS_GH_PUSH_TOKEN }} | |
- name: Finish check-in | |
if: github.event_name == 'schedule' | |
run: bash bin/monitor.sh stop | |
env: | |
SENTRY_DSN: ${{ secrets.COURSE_DATA_TOOLS_GH_SENTRY_DSN }} | |
TARGET_ENV: 'production' | |
- name: Check for errors | |
if: github.event_name == 'schedule' && failure() | |
run: bash bin/monitor.sh fail | |
env: | |
SENTRY_DSN: ${{ secrets.COURSE_DATA_TOOLS_GH_SENTRY_DSN }} | |
TARGET_ENV: 'production' |