-
Notifications
You must be signed in to change notification settings - Fork 34
46 lines (37 loc) · 1.28 KB
/
prod-update.yaml
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
43
44
45
46
name: Semester Data Update
on:
schedule:
- cron: "0 * * * *"
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
strategy:
matrix:
semester: [summer-2023]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-parser-${{ hashFiles('rpi_data/modules/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-parser
- name: Install parser dependencies
run: pip install -r requirements.txt
working-directory: rpi_data/modules
- name: Get course data
run: bash $SCRIPT_NAME
working-directory: rpi_data
env:
SCRIPT_NAME: get-${{ matrix.semester }}.sh
- name: Update prod
run: |
curl -X POST -H "Content-Type: multipart/form-data" -F "isPubliclyVisible=on" -F "file=@$FILE_NAME" -A "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0" $AUTH_ARGS $API_ENDPOINT
env:
FILE_NAME: ${{ matrix.semester }}.csv
AUTH_ARGS: ${{ secrets.AUTH_ARGS }}
API_ENDPOINT: ${{ secrets.UPDATE_API_ENDPOINT }}
working-directory: rpi_data