Skip to content

Fetch JSON Data and Push to Artsdata #2

Fetch JSON Data and Push to Artsdata

Fetch JSON Data and Push to Artsdata #2

name: Get Data
on:
workflow_dispatch:
jobs:
fetch-data:
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://system.spektrix.com/kaymeekcentre/api/v3/events' >> entities.json
- name: Download project-configuration-file
id: step-4
run: |
curl 'https://raw.githubusercontent.com/culturecreates/artsdata-planet-spektrix/main/ontorefine/configuration.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@v2
with:
name: entities
path: ./entities.ttl
retention-days: 1
commit-and-push:
runs-on: ubuntu-latest
needs: fetch-data
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download artifacts
id: download-step
uses: actions/download-artifact@v2
with:
name: entities
path: ./entities
- name: Copy files
run: |
mkdir -p outputs
cp /home/runner/work/artsdata-planet-spektrix/artsdata-planet-spektrix/entities/entities.ttl ./outputs/entities.ttl
- name: Commit file to GitHub
run: |
git pull
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git add "outputs/entities.ttl"
git commit -m "Push Event TTL file"
git push
# artsdata-push:
# runs-on: ubuntu-latest
# needs: fetch-data
# steps:
# - name: Action setup
# uses: culturecreates/[email protected]
# with:
# artifact: spektrix-kaymeekcentre
# publisher: "${{ secrets.PUBLISHER_URI_GREGORY }}"
# downloadUrl: https://raw.githubusercontent.com/culturecreates/artsdata-planet-osac/${{ needs.fetch-and-commit-data.outputs.commit-hash }}/outputs/${{ matrix.file }}