-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (40 loc) · 1.08 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Generate courses
on:
workflow_dispatch:
push:
branches:
- main
schedule:
- cron: '0 8 * * *'
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main
path: main
- name: Checkout gh-pages
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Generate courses
run: |
python -u ./main/courses_to_json.py last-3 './gh-pages/courses_{year}_{semester}.json'
- name: Deploy
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git diff-index --quiet --cached HEAD || git commit -m "Update courses"
git push