submissions-score-dashboard #501
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
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | |
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | |
on: | |
schedule: | |
- cron: '0 4 * * *' | |
workflow_dispatch: | |
name: submissions-score-dashboard | |
jobs: | |
submissions: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
OSN_KEY: ${{ secrets.OSN_KEY }} | |
OSN_SECRET: ${{ secrets.OSN_SECRET }} | |
container: rqthomas/vera-rocker:latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Process submissions | |
shell: Rscript {0} | |
run: | | |
source("submission_processing/process_submissions.R") | |
- name: Build inventory | |
shell: Rscript {0} | |
run: | | |
source("submission_processing/build_forecast_inventory.R") | |
scores: | |
needs: submissions | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
OSN_KEY: ${{ secrets.OSN_KEY }} | |
OSN_SECRET: ${{ secrets.OSN_SECRET }} | |
container: rqthomas/vera-rocker:latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Generate scores | |
shell: Rscript {0} | |
run: | | |
source("scoring/scoring.R") | |
- name: Update inventory | |
shell: Rscript {0} | |
run: | | |
source("scoring/build_score_inventory.R") | |
bundling: | |
needs: scores | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
OSN_KEY: ${{ secrets.OSN_KEY }} | |
OSN_SECRET: ${{ secrets.OSN_SECRET }} | |
container: rqthomas/vera-rocker:latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install | |
shell: Rscript {0} | |
run: | | |
print(options("repos")) | |
remotes::install_deps(".", dep=TRUE) | |
- name: Create bundles | |
shell: Rscript {0} | |
run: | | |
source("submission_processing/bundled-parquet.R") | |
dashboard: | |
needs: bundling | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
container: rqthomas/vera-rocker:latest | |
steps: | |
- run: git config --system --add safe.directory '*' | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
set-safe-directory: '*' | |
- uses: quarto-dev/quarto-actions/setup@v2 | |
with: | |
version: 1.4.146 | |
#- name: pull scores cache | |
# shell: Rscript {0} | |
# run: source("dashboard/cache.R") | |
- name: Render | |
run: | | |
quarto render dashboard | |
- name: Build site map | |
shell: Rscript {0} | |
run: source("dashboard/build_site_map.R") | |
- name: Publish | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
git checkout gh-pages | |
cp -r dashboard/docs/* . | |
git add . | |
git commit -a -m "update pages" || echo "nothing to commit" | |
git push https://${GITHUB_PAT}:${GITHUB_PAT}@github.com/${GITHUB_REPOSITORY} | |
- name: Ping Healthchecks | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y curl | |
curl -m 10 --retry 5 https://hc-ping.com/0bc60dc5-c1c8-4ab6-ad0a-9ae111430950 |