-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) · 1.1 KB
/
backup_queries.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
name: Update Queries
on:
schedule:
- cron: '0 1 * * *'
workflow_dispatch:
jobs:
update_queries:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install dependencies
run: |
pip install requests
- name: Run update script
run: python3 "${{ github.workspace }}/retrieve-queries.py"
env:
API_URL: https://api.linkeddata.cultureelerfgoed.nl/queries/
OUTPUT_FOLDER: "${{ github.workspace }}/LDV"
- name: Check for changes
id: check_changes
run: |
if git diff --exit-code; then
echo "No changes to commit"
exit 0
fi
exit 1
- name: Commit and push changes
if: steps.check_changes.outcome == 'failure'
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
git add .
git commit -m "Automated update of sparql queries"
git push