Dump GTQ #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Dump GTQ to S3 | |
on: | |
schedule: | |
- cron: "0 10 * * *" # Run daily at 10 AM UTC | |
workflow_dispatch: | |
jobs: | |
deploy: | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }} | |
AWS_REGION: ca-central-1 | |
WEBHOSTING_BUCKET_NAME: huginn-data | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download events from Artsdata | |
run: curl --header 'Accept:application/json' 'http://api.artsdata.ca/query.jsonld?limit=300&frame=lavitrine/events3&sparql=lavitrine/events3&graph=http://kg.artsdata.ca/culture-creates/huginn/derived-grandtheatre-qc-ca' > grandtheatre-qc-ca.json | |
- name: Set current date as output | |
id: version # this is used on variable path | |
run: echo "dumpdate=$(date +'%Y-%m-%dT%H-%M-%S')" >> $GITHUB_OUTPUT | |
- name: Upload to S3 | |
run: aws s3 cp grandtheatre-qc-ca.json s3://${{ env.WEBHOSTING_BUCKET_NAME }}/grandtheatre-qc-ca-${{ steps.version.outputs.dumpdate }}.json --acl public-read | |
- name: Register dump in Artsdata Databus # TODO add "reportCallbackUrl" to Github logs | |
run: | | |
curl \ | |
-H 'Content-Type: application/json' \ | |
-X POST http://api.artsdata.ca/databus/ \ | |
--data '{ "publisher": "https://saumier.github.io/gregory-saumier-finch.ttl%23this", | |
"group": "artsdata-planet-lavitrine", | |
"artifact": "grandtheatre-qc-ca", | |
"version": "grandtheatre-qc-ca-${{ steps.version.outputs.dumpdate }}", | |
"downloadUrl": "https://${{ env.WEBHOSTING_BUCKET_NAME }}.s3.ca-central-1.amazonaws.com/grandtheatre-qc-ca-${{ steps.version.outputs.dumpdate }}.json", | |
"downloadFile": "grandtheatre-qc-ca.ttl", | |
"comment": "Dump of grandtheatre.qc.ca using Github workflows", | |
"reportCallbackUrl": "https://huginn-staging.herokuapp.com/users/1/web_requests/273/databus", | |
"shacl": "artsdata" | |
}' |