-
Notifications
You must be signed in to change notification settings - Fork 2
89 lines (75 loc) · 2.04 KB
/
sites-workflow.yml
File metadata and controls
89 lines (75 loc) · 2.04 KB
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
84
85
86
87
88
89
name: CKAN Sites Workflow
on:
schedule:
# Run daily at 2 AM UTC
- cron: '0 2 * * *'
workflow_dispatch:
# Allow manual trigger
push:
branches:
- main
paths:
- 'sites-workflow/**'
- '.github/workflows/sites-workflow.yml'
jobs:
process-sites:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
cd sites-workflow
pip install -r requirements.txt
- name: Step 1 - Get Sites URLs
run: |
cd sites-workflow
python 1getSitesURL.py
- name: Step 2 - Collect CKAN Statistics
run: |
cd sites-workflow
python 2CKANActionAPI.py
- name: Step 3.1 - Download Existing Dataset
run: |
cd sites-workflow
python 31downloadDataset.py
- name: Step 3.2 - Merge Data
run: |
cd sites-workflow
python 32merger.py
- name: Step 3.3 - Delete Old Resources
run: |
cd sites-workflow
python 33delete.py
env:
CKAN_API_KEY: ${{ secrets.CKAN_API_KEY }}
- name: Step 3 - Update Sites Catalog
run: |
cd sites-workflow
python 3updateSitesCatalog.py
env:
CKAN_API_KEY: ${{ secrets.CKAN_API_KEY }}
- name: Step 4 - Upload Dataset
run: |
cd sites-workflow
python 4uploadDataset.py
env:
CKAN_API_KEY: ${{ secrets.CKAN_API_KEY }}
- name: Archive artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: workflow-outputs
path: |
sites-workflow/*.csv
sites-workflow/*.json
retention-days: 30
- name: Notify on failure
if: failure()
run: |
echo "Workflow failed. Check the logs for details."
# Add notification logic here (email, Slack, etc.)