-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (61 loc) · 2.05 KB
/
update-data.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Update Course Data
on:
schedule:
- cron: '0 2 * * *'
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
update-data:
# Adapted from https://github.com/StoDevX/AAO-React-Native/blob/master/.github/workflows/cocoapods.yml
name: Course Data Update
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
matrix:
python-version: ["3.7"]
steps:
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.COURSE_DATA_BOT_APP_ID }}
private-key: ${{ secrets.COURSE_DATA_BOT_APP_PEM }}
installation-id: ${{ github.event.installation.id }}
- uses: actions/checkout@v3
with:
token: ${{ steps.generate_token.outputs.token }}
- name: Start check-in
if: github.event_name == 'schedule'
run: bash bin/monitor.sh start
env:
SENTRY_DSN: ${{ secrets.COURSE_DATA_TOOLS_GH_SENTRY_DSN }}
TARGET_ENV: 'production'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: push-on-course-data-change
run: bash bin/github.sh
env:
GITHUB_BRANCH: ${{ github.ref_name }}
head_ref: ${{ github.ref }}
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
- name: Finish check-in
if: github.event_name == 'schedule'
run: bash bin/monitor.sh stop
env:
SENTRY_DSN: ${{ secrets.COURSE_DATA_TOOLS_GH_SENTRY_DSN }}
TARGET_ENV: 'production'
- name: Check for errors
if: github.event_name == 'schedule' && failure()
run: bash bin/monitor.sh fail
env:
SENTRY_DSN: ${{ secrets.COURSE_DATA_TOOLS_GH_SENTRY_DSN }}
TARGET_ENV: 'production'