Skip to content

Artsdata Export

Artsdata Export #217

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 # TODO add "reportCallbackUrl" to Github logs
run: |
curl \
-H 'Content-Type: application/json' \
-X POST http://api.artsdata.ca/databus/ \
--data '{ "artifact": "grandtheatre-qc-ca",
"comment": "Dump of grandtheatre.qc.ca using Github workflows",
"publisher": "${{ secrets.PUBLISHER_URI_GREGORY }}",
"group": "${{ github.event.repository.name }}",
"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",
"reportCallbackUrl": "https://huginn-staging.herokuapp.com/users/1/web_requests/273/databus",
"register_only": "true"
}'
- name: placedesarts-com dump # TODO add "reportCallbackUrl" to Github logs
run: |
curl \
-H 'Content-Type: application/json' \
-X POST http://api.artsdata.ca/databus/ \
--data '{ "publisher": "${{ secrets.PUBLISHER_URI_GREGORY }}",
"group": "${{ github.event.repository.name }}",
"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"
}'
- name: dia-logGraphs dump # TODO add "reportCallbackUrl" to Github logs
run: |
curl \
-H 'Content-Type: application/json' \
-X POST http://api.artsdata.ca/databus/ \
--data '{ "publisher": "${{ secrets.PUBLISHER_URI_GREGORY }}",
"group": "${{ github.event.repository.name }}",
"artifact": "dia-logGraphs",
"version": "${{ steps.version.outputs.dumpdate }}",
"downloadUrl": "https://${{ env.WEBHOSTING_BUCKET_NAME }}.s3.ca-central-1.amazonaws.com/lavitrine/${{ steps.version.outputs.dumpdate }}/dia-logGraphs.json",
"downloadFile": "dia-logGraphs.json",
"comment": "Dump of dia-log Websites using Github workflows",
"reportCallbackUrl": "https://huginn-staging.herokuapp.com/users/1/web_requests/273/databus",
"register_only": "true"
}'
- name: hector-charland-com dump # TODO add "reportCallbackUrl" to Github logs
run: |
curl \
-H 'Content-Type: application/json' \
-X POST http://api.artsdata.ca/databus/ \
--data '{ "publisher": "${{ secrets.PUBLISHER_URI_GREGORY }}",
"group": "${{ github.event.repository.name }}",
"artifact": "hector-charland-com",
"version": "${{ steps.version.outputs.dumpdate }}",
"downloadUrl": "https://${{ env.WEBHOSTING_BUCKET_NAME }}.s3.ca-central-1.amazonaws.com/lavitrine/${{ steps.version.outputs.dumpdate }}/hector-charland-com.json",
"downloadFile": "hector-charland-com.json",
"comment": "Dump of hector-charland-com Websites using Github workflows",
"reportCallbackUrl": "https://huginn-staging.herokuapp.com/users/1/web_requests/273/databus",
"register_only": "true"
}'
- name: theatredumarais-com dump # TODO add "reportCallbackUrl" to Github logs
run: |
curl \
-H 'Content-Type: application/json' \
-X POST http://api.artsdata.ca/databus/ \
--data '{ "publisher": "${{secrets.PUBLISHER_URI_GREGORY}}",
"group": "${{ github.event.repository.name }}",
"artifact": "theatredumarais-com",
"version": "${{ steps.version.outputs.dumpdate }}",
"downloadUrl": "https://${{ env.WEBHOSTING_BUCKET_NAME }}.s3.ca-central-1.amazonaws.com/lavitrine/${{ steps.version.outputs.dumpdate }}/theatredumarais-com.json",
"downloadFile": "theatredumarais-com.json",
"comment": "Dump of theatredumarais-com Websites using Github workflows",
"reportCallbackUrl": "https://huginn-staging.herokuapp.com/users/1/web_requests/273/databus",
"register_only": "true"
}'
- name: signe-laval-cms-events dump # TODO add "reportCallbackUrl" to Github logs
run: |
curl \
-H 'Content-Type: application/json' \
-X POST http://api.artsdata.ca/databus/ \
--data '{ "publisher": "${{secrets.PUBLISHER_URI_GREGORY}}",
"group": "${{ github.event.repository.name }}",
"artifact": "signe-laval-cms-events",
"version": "${{ steps.version.outputs.dumpdate }}",
"downloadUrl": "https://${{ env.WEBHOSTING_BUCKET_NAME }}.s3.ca-central-1.amazonaws.com/lavitrine/${{ steps.version.outputs.dumpdate }}/signe-laval-cms-events.json",
"downloadFile": "signe-laval-cms-events.json",
"comment": "Dump of signe-laval-cms-events from Footlight CMS using Github workflows",
"reportCallbackUrl": "https://huginn-staging.herokuapp.com/users/1/web_requests/273/databus",
"register_only": "true"
}'
- name: tout-culture-cms-events dump # TODO add "reportCallbackUrl" to Github logs
run: |
curl \
-H 'Content-Type: application/json' \
-X POST http://api.artsdata.ca/databus/ \
--data '{ "publisher": "${{secrets.PUBLISHER_URI_GREGORY}}",
"group": "${{ github.event.repository.name }}",
"artifact": "tout-culture-cms-events",
"version": "${{ steps.version.outputs.dumpdate }}",
"downloadUrl": "https://${{ env.WEBHOSTING_BUCKET_NAME }}.s3.ca-central-1.amazonaws.com/lavitrine/${{ steps.version.outputs.dumpdate }}/tout-culture-cms-events.json",
"downloadFile": "tout-culture-cms-events.json",
"comment": "Dump of tout-culture-cms-events from Footlight CMS using Github workflows",
"reportCallbackUrl": "https://huginn-staging.herokuapp.com/users/1/web_requests/273/databus",
"register_only": "true"
}'
- name: culture-mauricie-cms-events dump # TODO add "reportCallbackUrl" to Github logs
run: |
curl \
-H 'Content-Type: application/json' \
-X POST http://api.artsdata.ca/databus/ \
--data '{ "publisher": "${{secrets.PUBLISHER_URI_GREGORY}}",
"group": "${{ github.event.repository.name }}",
"artifact": "culture-mauricie-cms-events",
"version": "${{ steps.version.outputs.dumpdate }}",
"downloadUrl": "https://${{ env.WEBHOSTING_BUCKET_NAME }}.s3.ca-central-1.amazonaws.com/lavitrine/${{ steps.version.outputs.dumpdate }}/culture-mauricie-cms-events.json",
"downloadFile": "culture-mauricie-cms-events.json",
"comment": "Dump of culture-mauricie-cms-events from Footlight CMS using Github workflows",
"reportCallbackUrl": "https://huginn-staging.herokuapp.com/users/1/web_requests/273/databus",
"register_only": "true"
}'