Skip to content

Artsdata Export

Artsdata Export #28

name: Artsdata Export
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:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
with:
bundler-cache: true
- run: bundle install
- name: Run pipelines
run: mkdir output ; cd src ; bundle exec ruby batch.rb
- 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 ./output/ s3://${{ env.WEBHOSTING_BUCKET_NAME }}/lavitrine/${{ steps.version.outputs.dumpdate }}/ --acl public-read --recursive
- name: grandtheatre-qc-ca dump register_only on 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": "${{ steps.version.outputs.dumpdate }}",
"downloadUrl": "https://${{ env.WEBHOSTING_BUCKET_NAME }}.s3.ca-central-1.amazonaws.com/lavitrine/${{ steps.version.outputs.dumpdate }}/derived-grandtheatre-qc-ca.json",
"downloadFile": "derived-grandtheatre-qc-ca.json",
"comment": "Dump of grandtheatre.qc.ca using Github workflows",
"reportCallbackUrl": "https://huginn-staging.herokuapp.com/users/1/web_requests/273/databus",
"register_only": "true"
}'
- name: placedesarts-com dump register_only on 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": "placedesarts-com",
"version": "${{ steps.version.outputs.dumpdate }}",
"downloadUrl": "https://${{ env.WEBHOSTING_BUCKET_NAME }}.s3.ca-central-1.amazonaws.com/lavitrine/${{ steps.version.outputs.dumpdate }}/placedesarts-com.json",
"downloadFile": "placedesarts-com.json",
"comment": "Dump of placedesarts.com using Github workflows",
"reportCallbackUrl": "https://huginn-staging.herokuapp.com/users/1/web_requests/273/databus",
"register_only": "true"
}'