Skip to content

Create country reports #12

Create country reports

Create country reports #12

name: "Create country reports"
on:
workflow_dispatch:
schedule:
- cron: "0 16 * * 1"
push:
branches: main
paths:
- code/reports/**
pull_request:
branches: main
paths:
- code/reports/**
jobs:
country_reports:
if: github.repository_owner == 'european-modelling-hubs'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-r@v2
with:
install-r: false
use-public-rspm: true
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libssl-dev libcurl4-openssl-dev
- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-renv@v2
- name: Create country reports
run: Rscript 'code/reports/compile-country-reports.r'
- uses: actions/upload-artifact@v3
if: github.event_name != 'pull_request'
with:
name: country-reports
retention-days: 8
path: |
html/
- uses: actions/upload-artifact@v3
# If we are in a PR, we want to access the artifacts but we don't want
# them to be used to build the site
if: github.event_name == 'pull_request'
with:
name: country-reports-${{ env.GITHUB_RUN_ID }}
retention-days: 8
path: |
html/
- name: Trigger website rebuild
if: github.event_name != 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.FORECASTHUB_TOKEN }}
run: |
gh workflow run build-and-deploy.yml -R european-modelling-hubs/covid19-forecast-hub-europe-website
- name: Create issue about failure
if: failure() && github.event_name != 'workflow_dispatch' && github.event_name != 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh issue reopen 2633