forked from eco4cast/neon4cast-ci
-
Notifications
You must be signed in to change notification settings - Fork 2
131 lines (112 loc) · 3.61 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# 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-catalog
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")
catalog:
needs: scores
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
OSN_KEY: ${{ secrets.OSN_KEY }}
OSN_SECRET: ${{ secrets.OSN_SECRET }}
#container: rocker/geospatial:latest
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: '*'
- name: install validator
run: |
pip install stac-validator
- name: Render
shell: Rscript {0}
run: source("catalog/update_stac.R")
- name: Commit and Push
run: |
git config user.name github-actions
git config user.email [email protected]
git pull
git add catalog/* .
git commit -a -m "update catalog" || echo "nothing to commit"
git push https://${GITHUB_PAT}:${GITHUB_PAT}@github.com/${GITHUB_REPOSITORY}
dashboard:
needs: catalog
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}