run-archiver #150
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: | |
- eia860 | |
- eia923 | |
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 --sandbox --initialize --datasets ${{ matrix.dataset }} --dry-run --summary-file ${{ matrix.dataset }}_run_summary.json | |
- 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: test Slack Action | |
uses: slackapi/slack-github-action@v1.24.0 | |
with: | |
payload: | | |
{ | |
"text": "Text: GitHub Action build result: ${{ job.status }}", | |
"blocks": [ | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "Block: GitHub Action build result: ${{ job.status }}" | |
} | |
} | |
] | |
} | |
- name: Inform the Codemonkeys | |
uses: slackapi/slack-github-action@v1.24.0 | |
with: | |
payload: ${{ steps.all_summaries.outputs.SLACK_PAYLOAD }} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required |