Scheduled Run - Undergraduate Courses #40
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: Scheduled Run - Undergraduate Courses | |
on: | |
schedule: | |
# At 18:50 UTC on everyday (12.20 mid night in Sri Lanka) | |
# - cron: "50 18 * * *" | |
# At 00:00 on Sunday. | |
- cron: "0 0 * * 0" | |
# Enables a button on Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@master | |
with: | |
ref: main | |
- name: Setup Python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
cache: 'pip' | |
- name: Install Python Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: "Generate Course data collection" | |
run: | | |
cd ./python_scripts/undergraduate_courses/ | |
python3 aggregate_course.py | |
cd ../../ | |
- name: "Create and update the Semester pages" | |
run: | | |
cd ./python_scripts/undergraduate_courses/ | |
python3 generate_semester_pages.py | |
cd ../../ | |
- name: "Create and update the Course pages" | |
run: | | |
cd ./python_scripts/undergraduate_courses/ | |
python3 generate_course_pages.py | |
cd ../../ | |
- name: Commit and push into the main branch | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add --all | |
git commit -m "Repo was updated by GitHub Actions" || echo "No changes to commit on the repo" | |
git push |