submissions-score-dashboard #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
# 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 5 * * *' | |
workflow_dispatch: | |
name: submissions-score-dashboard | |
jobs: | |
submissions: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
AWS_ACCESS_KEY_SUBMISSIONS: ${{ secrets.AWS_ACCESS_KEY_SUBMISSIONS }} | |
AWS_SECRET_ACCESS_KEY_SUBMISSIONS: ${{ secrets.AWS_SECRET_ACCESS_KEY_SUBMISSIONS }} | |
OSN_KEY: ${{ secrets.OSN_KEY }} | |
OSN_SECRET: ${{ secrets.OSN_SECRET }} | |
container: eco4cast/rocker-neon4cast:latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: prod | |
- name: Process submissions | |
shell: Rscript {0} | |
run: | | |
source("submission_processing/process_submissions.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: eco4cast/rocker-neon4cast:latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: prod | |
- name: Generate scores | |
shell: Rscript {0} | |
run: | | |
source("scoring/scoring.R") | |
- name: Update inventory | |
shell: Rscript {0} | |
run: | | |
source("scoring/build_score_inventory.R") | |
dashboard: | |
needs: scores | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
container: eco4cast/rocker-neon4cast:latest | |
steps: | |
- run: git config --system --add safe.directory '*' | |
- uses: actions/checkout@v3 | |
with: | |
ref: prod | |
fetch-depth: 0 | |
set-safe-directory: '*' | |
- uses: quarto-dev/quarto-actions/setup@v2 | |
with: | |
version: 1.4.146 | |
- name: install deps | |
shell: Rscript {0} | |
run: remotes::install_deps(".", dep=TRUE) | |
- 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} |