diff --git a/.github/workflows/osac-events.yml b/.github/workflows/osac-events.yml new file mode 100644 index 0000000..630237b --- /dev/null +++ b/.github/workflows/osac-events.yml @@ -0,0 +1,53 @@ +name: Fetch OSAC Events + +on: + workflow_dispatch: + +jobs: + fetch-and-commit-data: + runs-on: ubuntu-latest + outputs: + commit-hash: ${{ steps.get_commit_hash.outputs.commit-hash }} + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: Run Main Script + run: | + bundle exec ruby src/main.rb \ + https://www.osac.ca/performing-arts/performances?run=patours \ + "td a" \ + output/osac-events.jsonld \ + false + + - name: Commit and Push Changes + run: | + git config --local user.email "actions@github.com" + git config --local user.name "GitHub Actions" + git pull + git add "output/osac-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: fetch-and-commit-data + steps: + - name: Action setup + uses: culturecreates/artsdata-pipeline-action@v1.1.0 + with: + artifact: osac-ca + publisher: "${{ secrets.PUBLISHER_URI_GREGORY }}" + downloadUrl: https://raw.githubusercontent.com/culturecreates/artsdata-orion/${{ needs.fetch-and-commit-data.outputs.commit-hash }}/output/osac-events.jsonld \ No newline at end of file