Update rooms.json #249
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 rooms.json | |
on: | |
push: | |
paths-ignore: | |
- 'rooms.json' | |
schedule: | |
- cron: '55 4 * * 0-5' # Weekdays @ EOD (11:55 PM PST) + Sundays for weekend drops/adds | |
workflow_dispatch: | |
jobs: | |
course-updater: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repo | |
uses: actions/checkout@v3 | |
- run: dir | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
cache-dependency-path: modules.txt | |
- run: pip install -r modules.txt | |
- name: Run convert.py | |
run: | | |
python convert.py | |
rm courses.json && dir | |
- name: Push updates | |
run: | | |
git add -A | |
if [ -n "$(git status --porcelain)" ]; then | |
git config user.name "Vacansee" | |
git config user.email "[email protected]" | |
git commit -m "Updated on $(TZ=EST5EDT date)" | |
git push origin main | |
else | |
echo "No changes to commit" | |
fi | |
env: | |
github_token: ${{ secrets.GITHUB_TOKEN }} |