Download data required by ScopeSim #551
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: Download data required by ScopeSim | |
on: | |
schedule: | |
# Run every day at 5:00 UTC | |
- cron: "0 5 * * *" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
download_data: | |
runs-on: ubuntu-latest | |
timeout-minutes: 180 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e . | |
- name: Run download script | |
run: bash bin/download_scopesim_data.sh | |
# Create a PR with the changes from the above script, if any. | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v5 # current version is v7, maybe update... | |
with: | |
commit-message: "Update stored data" | |
branch: update-stored-data | |
delete-branch: true | |
title: "[Assist PR] Update stored data" | |
body: | | |
Update stored data. | |
Auto-generated. | |
labels: | | |
automated | |
draft: false | |
on-failure: | |
runs-on: ubuntu-latest | |
if: ${{ always() && (needs.download_data.result == 'failure' || needs.download_data.result == 'timed_out') }} | |
needs: | |
- download_data | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Slack Notification | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_USERNAME: GH Actions Bot | |
SLACK_TITLE: Workflow ${{ needs.download_data.result }} | |
MSG_MINIMAL: actions url | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} | |
SLACK_COLOR: ${{ needs.download_data.result }} |