-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (50 loc) · 1.89 KB
/
scenesfrancophones-entities.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
name: Fetch Scenesfrancophones Entities
on:
workflow_dispatch:
schedule:
- cron: "0 5 * * 1" # Run at 1:00 AM ET every Monday
jobs:
fetch-and-commit-data:
runs-on: ubuntu-latest
outputs:
changes: ${{ steps.check-changes.outputs.HAS_CHANGES }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: curl-jsonld
run: |
curl https://scenesfrancophones.ca/donneesouvertes/evenements.json > output/events.jsonld \
curl https://scenesfrancophones.ca/donneesouvertes/artistes.json > output/artists.jsonld \
curl https://scenesfrancophones.ca/donneesouvertes/lieux.json > output/places.jsonld
- name: combine-jsonld
run : |
cd output
jq -s '[ .[] | .[] ]' artists.jsonld events.jsonld places.jsonld > combined.jsonld
- name: Check for file changes
id: check-changes
run: |
if git status --porcelain | grep -q 'output/combined.jsonld'; then
echo "HAS_CHANGES=true" >> $GITHUB_OUTPUT
else
echo "HAS_CHANGES=false" >> $GITHUB_OUTPUT
fi
- name: Commit and Push Changes
if: steps.check-changes.outputs.HAS_CHANGES == 'true'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git pull
git add output
git commit -m "Add data generated by the script"
git push
artsdata-push:
runs-on: ubuntu-latest
needs: fetch-and-commit-data
if: needs.fetch-and-commit-data.outputs.changes == 'true'
steps:
- name: Action setup
uses: culturecreates/[email protected]
with:
artifact: scenesfrancophones-ca
publisher: "${{ secrets.PUBLISHER_URI_GREGORY }}"
downloadUrl: "https://raw.githubusercontent.com/culturecreates/artsdata-planet-scenesfrancophones/main/output/combined.jsonld"