Skip to content

Run Cogeco Aggregator #311

Run Cogeco Aggregator

Run Cogeco Aggregator #311

name: Run Cogeco Aggregator
on:
workflow_dispatch:
schedule:
- cron: "0 8 * * *" # Run at 4:00 AM ET everyday
jobs:
transform-data-into-rdf:
runs-on: ubuntu-latest
container:
image: ontotext/refine:1.2.1
options: --user root
ports:
- 7333:7333
steps:
- name: Install requirements
run: apk update && apk add curl && apk add util-linux
- name: Run ontorefine server
run: /opt/ontorefine/dist/bin/ontorefine &
- name: Download data from the API
run: |
curl 'https://amphitheatrecogeco.com/json?module=spectacle&method=getspectacles' >> entities.json
- name: Download project-configuration-file
id: step-4
run: |
curl 'https://raw.githubusercontent.com/culturecreates/footlight-aggregator/main/data/ontorefine/cogeco-ontorefine-project-configurations.json' >> project-config.json
- name: Transform json data to RDF
run: |
/opt/ontorefine/dist/bin/ontorefine-cli \
transform entities.json \
-u http://localhost:7333 \
--configurations project-config.json \
-f json >> entities.ttl
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: entities
path: ./entities.ttl
retention-days: 1
run-aggregator-and-import:
needs: transform-data-into-rdf
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: npm install
- name: Make envfile
uses: SpicyPizza/[email protected]
with:
envkey_DATA_DOG_CLIENT_TOKEN: ${{ secrets.DATA_DOG_CLIENT_TOKEN }}
envkey_ENABLING_LOG_TO_DATA_DOG: true
envkey_CMS_REFERER_HEADER: ${{ vars.CMS_REFERER_HEADER }}
file_name: .env
fail_on_empty: false
- name: Build Footlight Aggregator
run: npm run build
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: entities
- name: Import entities to footlight
run: |
node ./dist/main-commander.js import:rdf -u ${{vars.AGGREGATOR_USER_COGECO}} -p ${{secrets.AGGREGATOR_PASSWORD_COGECO}} -i 'https://api.cms.footlight.io' -c 657199fea5ac3d006314ea92 -r '/home/runner/work/footlight-aggregator/footlight-aggregator/entities.ttl' -m 'https://raw.githubusercontent.com/culturecreates/footlight-aggregator/main/data/cogeco-cms-mapping.json'