Skip to content

Scheduled Run - Undergraduate Courses #9

Scheduled Run - Undergraduate Courses

Scheduled Run - Undergraduate Courses #9

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 github-actions@github.com
git add --all
git commit -m "Repo was updated by GitHub Actions" || echo "No changes to commit on the repo"
git push