run-archiver #161
Workflow file for this run
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: run-archiver | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "21 4 1 * *" # 4:21 AM UTC, first of every month | |
jobs: | |
archive-run: | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
matrix: | |
dataset: | |
- epacems | |
fail-fast: false | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Conda environment using mamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: environment.yml | |
cache-environment: true | |
condarc: | | |
channels: | |
- conda-forge | |
- defaults | |
channel_priority: strict | |
- name: Log the conda environment | |
run: | | |
conda info | |
conda list | |
conda config --show-sources | |
conda config --show | |
printenv | sort | |
- name: Run archiver for ${{ matrix.dataset }} | |
env: | |
ZENODO_SANDBOX_TOKEN_UPLOAD: ${{ secrets.ZENODO_SANDBOX_TOKEN_UPLOAD }} | |
ZENODO_SANDBOX_TOKEN_PUBLISH: ${{ secrets.ZENODO_SANDBOX_TOKEN_PUBLISH }} | |
EPACEMS_API_KEY: ${{ secrets.EPACEMS_API_KEY }} | |
ZENODO_TOKEN_UPLOAD: ${{ secrets.ZENODO_TOKEN_UPLOAD }} | |
ZENODO_TOKEN_PUBLISH: ${{ secrets.ZENODO_TOKEN_PUBLISH }} | |
run: | | |
pudl_archiver --datasets ${{ matrix.dataset }} --summary-file ${{ matrix.dataset }}_run_summary.json --sandbox | |
- name: Upload run summaries | |
id: upload_summaries | |
uses: actions/upload-artifact@v3 | |
with: | |
name: run-summaries | |
path: ${{ matrix.dataset }}_run_summary.json | |
archive-notify: | |
runs-on: ubuntu-latest | |
needs: archive-run | |
if: ${{ always() }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download summaries | |
id: download | |
uses: actions/download-artifact@v3 | |
with: | |
name: run-summaries | |
- name: show summaries | |
run: ls -R | |
- name: Munge summaries together | |
id: all_summaries | |
run: | | |
{ | |
echo "SLACK_PAYLOAD<<EOF" | |
./scripts/make_slack_notification_message.py --summary-files *_run_summary.json | tee slack-payload.json | |
echo "EOF" | |
} >> "$GITHUB_OUTPUT" | |
- name: Post update to pudl-deployment | |
uses: slackapi/slack-github-action@v1.24.0 | |
with: | |
channel-id: "C03FHB9N0PQ" | |
payload: ${{ steps.all_summaries.outputs.SLACK_PAYLOAD }} | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.PUDL_DEPLOY_SLACK_TOKEN }} |