-
Notifications
You must be signed in to change notification settings - Fork 94
69 lines (59 loc) · 1.89 KB
/
reports-country.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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 == 'covid19-forecast-hub-europe'
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 covid19-forecast-hub-europe/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