-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (33 loc) · 1.09 KB
/
database.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
name: "database"
on:
workflow_dispatch:
schedule:
- cron: "0 4 * * *"
env:
CURRENT_SEMESTER: 20242
jobs:
update-db:
name: Update database
runs-on: ubuntu-latest
container:
image: caravelahc/matrufsc:latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Generate
run: |
virtualenv --python=/usr/bin/python2 .venv
source .venv/bin/activate
pip install bs4
cd db/src
./get_turmas.py ${CURRENT_SEMESTER}
./parse_turmas.py ${CURRENT_SEMESTER}_*.xml ${CURRENT_SEMESTER}.json
git fetch
git checkout gh-pages
mv ${CURRENT_SEMESTER}.json ../../data/${CURRENT_SEMESTER}.json
git config user.email [email protected]
git config user.name caravelabot
git remote add pages https://caravelabot:${DEPLOY_ACCESS_TOKEN}@github.com/caravelahc/beta-matrufsc.git
git add -f ../../data/*.json || true
git commit -m "Update $(${CURRENT_SEMESTER}).json" || true
git push pages gh-pages -f