Refresh Course Plans #24
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: Refresh Course Plans | |
on: | |
schedule: | |
# At 00:00 on Tuesday. | |
- cron: "0 0 * * 2" | |
workflow_dispatch: | |
jobs: | |
refresh_course_plans: | |
runs-on: ubuntu-latest | |
steps: | |
# Clones the repo | |
- name: Checkout Repo Content | |
uses: actions/checkout@v4 | |
# Clones the data repo | |
- name: Clone Data Repo | |
uses: actions/checkout@v4 | |
with: | |
repository: itu-helper/data | |
token: ${{ secrets.API_TOKEN_GITHUB }} | |
path: ./data/ | |
# Go Back to the main repo | |
- name: Back to Main Repo | |
run: | | |
cd .. | |
# Sets up python | |
- name: Python Setup | |
uses: actions/[email protected] | |
with: | |
python-version: 3.11 | |
# Install the python requirements via pip | |
- name: Install Python Requirements | |
run: pip install -r requirements.txt | |
# Run the python script | |
- name: Python Run | |
run: | | |
python src/run.py -scrap_target course_plan | |
# Commits the changes back to the data repo | |
- name: Push course_plans.txt to itu-helper/data | |
uses: dmnemec/copy_file_to_another_repo_action@main | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} | |
with: | |
source_file: './data/course_plans.txt' | |
destination_repo: 'itu-helper/data' | |
user_email: '[email protected]' | |
user_name: 'ITU Helper' |