Skip to content

Fetch Capitolnb Events #11

Fetch Capitolnb Events

Fetch Capitolnb Events #11

name: Fetch Capitolnb Events
on:
workflow_dispatch:
jobs:
call-workflow-to-fetch-data:
uses: ./.github/workflows/fetch-and-push-to-artsdata.yml
with:
page_url: "https://capitol.nb.ca/en/tickets-events"
entity_identifier: "div.fc-item-block-standard-wrapper.odd a, div.fc-item-block-standard-wrapper.even a"
file_name: "capitolnb-events.jsonld"
is_paginated: "false"
headless: "true"
replace-location-name:
runs-on: ubuntu-latest
needs: call-workflow-to-fetch-data
outputs:
commit-hash: ${{ steps.get_commit_hash.outputs.commit-hash }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Replace location
run: |
FILE="output/capitolnb-events.jsonld"
sed -i 's/"@value": "Capitol Theatre"/"@id": "http:\/\/kg.artsdata.ca\/resource\/K11-116"/g' "$FILE"
sed -i 's/"@value": "Empress Theatre"/"@id": "http:\/\/kg.artsdata.ca\/resource\/K11-116"/g' "$FILE"
- name: Commit and Push Changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git pull
git add output/capitolnb-events.jsonld
git commit -m "Add data generated by the script"
git push
- name: Get commit hash
id: get_commit_hash
run: |
commit_hash=$(git rev-parse HEAD)
echo "commit-hash=$commit_hash" >> $GITHUB_OUTPUT
artsdata-push:
runs-on: ubuntu-latest
needs: replace-location-name
steps:
- name: Action setup
uses: culturecreates/[email protected]
with:
artifact: capitol-nb-ca
publisher: "${{ secrets.PUBLISHER_URI_GREGORY }}"
downloadUrl: https://raw.githubusercontent.com/culturecreates/artsdata-orion/${{ needs.replace-location-name.outputs.commit-hash }}/output/capitolnb-events.jsonld