-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto update prod fall 2021 courses every hour (#436)
* Add workflow to update prod courses * test run on current branch * Add python setup * run on ubuntu latest * Set working-direction for upload * Update every hour. Reduce class cache to an hour * Make semester publicly visible * Rename to Semester Data Update
- Loading branch information
1 parent
3174693
commit 9536027
Showing
2 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Semester Data Update | ||
|
||
on: | ||
schedule: | ||
- cron: "0 * * * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
update: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
semester: [fall-2021] | ||
|
||
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" $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 |
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