Import data #34
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: Import data | |
on: | |
schedule: | |
- cron: '0 11 * * 0' # Run every Sunday at 11am UTC | |
workflow_dispatch: | |
jobs: | |
run-script: | |
runs-on: ubuntu-latest | |
env: | |
HINDSIGHT_PAT_TOKEN: ${{ secrets.HINDSIGHT_PAT_TOKEN }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- name: Install pygithub | |
run: | | |
python -m pip install pygithub | |
- name: Run import script | |
run: | | |
python import_data_to_readme.py | |
- name: Add and commit | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: './plots/*' | |
message: 'update hindsight data from remote' | |
default_author: github_actions | |
- name: Post to failure to Slack Channel | |
if: ${{ failure() }} | |
id: slack_failure | |
uses: slackapi/[email protected] | |
with: | |
# Slack channel id, channel name, or user id to post message. | |
# See also: https://api.slack.com/methods/chat.postMessage#channels | |
# You can pass in multiple channels to post to by providing a comma-delimited list of channel IDs. | |
channel-id: 'core-compchem' | |
# For posting a simple plain text message | |
slack-message: "ASAP-hindsight data upload failed" | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
- name: Post to a Slack channel | |
id: slack_success | |
if: ${{ success() }} | |
uses: slackapi/[email protected] | |
with: | |
# Slack channel id, channel name, or user id to post message. | |
# See also: https://api.slack.com/methods/chat.postMessage#channels | |
# You can pass in multiple channels to post to by providing a comma-delimited list of channel IDs. | |
channel-id: 'core-compchem' | |
# For posting a simple plain text message | |
slack-message: "ASAP-hindsight data has been updated! Go check it out @ https://github.com/asapdiscovery/hindsight-public :sunglasses: :sunglasses: :sunglasses:" | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |