-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates KIAC crawl to use ferch and push workflow
- Loading branch information
1 parent
a9f998c
commit a6e261b
Showing
2 changed files
with
15 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,6 @@ name: Reusable workflow to fetch JSON-LD data. | |
|
||
on: | ||
workflow_call: | ||
outputs: | ||
commit-hash: | ||
value: ${{jobs.fetch-and-commit-data.outputs.commit-hash}} | ||
inputs: | ||
page_url: | ||
required: true | ||
|
@@ -28,55 +25,24 @@ on: | |
PUBLISHER_URI_GREGORY: | ||
required: true | ||
|
||
|
||
|
||
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@v2 | ||
with: | ||
repository: culturecreates/artsdata-orion | ||
ref: main | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
- name: Run Main Script | ||
run: | | ||
bundle exec ruby src/main.rb \ | ||
"${{ inputs.page_url }}" \ | ||
"${{ inputs.entity_identifier }}" \ | ||
output/${{ inputs.file_name }} \ | ||
${{ inputs.is_paginated}} \ | ||
${{ inputs.headless}} \ | ||
- 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/${{ inputs.file_name }}" | ||
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 | ||
call-workflow-to-fetch-data: | ||
uses: ./.github/workflows/fetch-data.yml | ||
with: | ||
page_url: ${{inputs.page_url}} | ||
entity_identifier: ${{inputs.entity_identifier}} | ||
file_name: ${{inputs.file_name}} | ||
is_paginated: ${{inputs.is_paginated}} | ||
headless: ${{inputs.headless}} | ||
|
||
artsdata-push: | ||
runs-on: ubuntu-latest | ||
needs: fetch-and-commit-data | ||
needs: call-workflow-to-fetch-data | ||
steps: | ||
- name: Action setup | ||
uses: culturecreates/[email protected] | ||
with: | ||
artifact: ${{ inputs.artifact }} | ||
publisher: "${{ secrets.PUBLISHER_URI_GREGORY }}" | ||
downloadUrl: https://raw.githubusercontent.com/culturecreates/artsdata-orion/${{ needs.fetch-and-commit-data.outputs.commit-hash }}/output/${{ inputs.file_name }} | ||
downloadUrl: https://raw.githubusercontent.com/culturecreates/artsdata-orion/${{ needs.call-workflow-to-fetch-data.outputs.commit-hash }}/output/${{ inputs.file_name }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,22 +6,14 @@ on: | |
- cron: '0 0 1 * *' | ||
|
||
jobs: | ||
call-workflow-to-fetch-data: | ||
uses: ./.github/workflows/fetch-data.yml | ||
call-workflow-to-fetch-and-push-data: | ||
uses: ./.github/workflows/fetch-and-push-to-artsdata.yml | ||
with: | ||
page_url: "https://kiac.ca/calendar-of-events/" | ||
entity_identifier: "div.tribe-events-pro-photo__event-featured-image-wrapper a" | ||
file_name: "kiac-events.jsonld" | ||
is_paginated: "false" | ||
headless: "false" | ||
|
||
artsdata-push: | ||
runs-on: ubuntu-latest | ||
needs: call-workflow-to-fetch-data | ||
steps: | ||
- name: Action setup | ||
uses: culturecreates/[email protected] | ||
with: | ||
artifact: kiac-ca | ||
publisher: "${{ secrets.PUBLISHER_URI_GREGORY }}" | ||
downloadUrl: https://raw.githubusercontent.com/culturecreates/artsdata-orion/${{ needs.call-workflow-to-fetch-data.outputs.commit-hash }}/output/kiac-events.jsonld | ||
artifact: "kiac-ca" | ||
secrets: | ||
PUBLISHER_URI_GREGORY: ${{ secrets.PUBLISHER_URI_GREGORY }} |