-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (66 loc) · 2.03 KB
/
update-universes.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
73
74
75
76
77
78
79
80
81
82
83
name: Update universes
on:
schedule:
- cron: '27 7 * * *'
workflow_dispatch:
jobs:
run-demo-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt
- name: Update demo universe
env:
DATAGOUV_URL: https://demo.data.gouv.fr
DATAGOUV_API_KEY: ${{ secrets.DATAGOUV_API_KEY_DEMO }}
run: |
python -u feed-universe.py universe-demo.yaml 2>&1 | tee logs/run_log_demo.txt
- name: Commit Run Logs
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add logs/run_log_demo.txt
git commit -m "Update daily run log for demo"
- name: Push changes
run: |
git pull --rebase origin ${{ github.ref_name }}
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run-prod-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt
- name: Update prod universe
env:
DATAGOUV_URL: https://www.data.gouv.fr
DATAGOUV_API_KEY: ${{ secrets.DATAGOUV_API_KEY_PROD }}
run: |
python -u feed-universe.py universe-prod.yaml 2>&1 | tee logs/run_log_prod.txt
- name: Commit Run Logs
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add logs/run_log_prod.txt
git commit -m "Update daily run log for prod"
- name: Push changes
run: |
git pull --rebase origin ${{ github.ref_name }}
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}