forked from eco4cast/neon4cast-ci
-
Notifications
You must be signed in to change notification settings - Fork 2
113 lines (95 loc) · 3.07 KB
/
combined.yaml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# 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: main
- 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: main
- 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: main
fetch-depth: 0
set-safe-directory: '*'
- name: Set up Python
run: |
sudo apt-get update
sudo apt-get install -y python3-venv python3-pip
- name: Create and activate virtual environment
run: |
python3 -m venv venv
echo "PATH=$(pwd)/venv/bin:$PATH" >> $GITHUB_ENV
- name: Install Python packages
run: |
. venv/bin/activate # Activate the virtual environment
pip install pandas
- 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: |
. venv/bin/activate
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}