Scrape #722
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
name: Scrape | |
on: | |
schedule: | |
- cron: "0 8 * * *" # 8 a.m. every day UTC | |
workflow_dispatch: | |
jobs: | |
scrape: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- run: pip install notebook requests bs4 | |
- name: Run scraper | |
run: jupyter execute scrape.ipynb | |
- name: Add and commit | |
id: add_commit | |
uses: EndBug/add-and-commit@v8 | |
with: | |
committer_name: Automated | |
committer_email: [email protected] | |
message: "Latest data" | |
- name: Slack Notification on SUCCESS | |
if: (success() && steps.add_commit.outputs.committed=='false') | |
uses: tokorom/action-slack-incoming-webhook@main | |
env: | |
INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} | |
with: | |
text: A successful scrape from Iris but nothing new! | |
- name: Slack Notification on FAILURE | |
if: failure() | |
uses: tokorom/action-slack-incoming-webhook@main | |
env: | |
INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} | |
with: | |
text: Something went wrong. | |
attachments: | | |
[ | |
{ | |
"color": "bad", | |
"author_name": "${{ github.actor }}", | |
"author_icon": "${{ github.event.sender.avatar_url }}", | |
"fields": [ | |
{ | |
"title": "GitHub Actions URL", | |
"value": "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" | |
} | |
] | |
} | |
] | |
- name: Slack Notification on new commits | |
if: (success() && steps.add_commit.outputs.committed=='true') | |
uses: tokorom/action-slack-incoming-webhook@main | |
env: | |
INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} | |
with: | |
text: IRIS new file alert!!! | |
attachments: | | |
[ | |
{ | |
"color": "good", | |
"author_name": "${{ github.actor }}", | |
"author_icon": "${{ github.event.sender.avatar_url }}", | |
"fields": [ | |
{ | |
"title": "GitHub Actions URL", | |
"value": "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" | |
}, | |
{ | |
"title": "Commit URL", | |
"value": "https://github.com/${{github.repository}}/commits" | |
} | |
] | |
} | |
] |