-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (123 loc) · 4.73 KB
/
hacim.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
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
name: build_dashboard
on:
# schedule:
# - cron: '0 21 * * 2,5' # Run on Tuesday and Friday 9pm UTC (5pm EST)
push:
branches:
- main
pull_request:
branches:
- main
# Cacnel previous runs if a new push is sent
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
generate-dashboard:
# Don't run if a pull request but not closed
if: github.event_name == 'schedule' || ((github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == 'true') || github.event_name == 'push')
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
pages: write
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
RENV_PATHS_ROOT: ~/.local/share/renv
steps:
- uses: actions/checkout@main
with:
repository: uva-bi-sdad/pre-pack-community
path: 'parent/pre-pack-community'
- uses: actions/checkout@main
with:
path: 'parent/${{ github.event.repository.name }}'
- uses: actions/checkout@main
with:
repository: uva-bi-sdad/social_data_commons
path: 'parent/social_data_commons'
- name: copy lock file to sdc
working-directory: ${{ github.workspace }}/parent/pre-pack-community
run: |
cp renv.lock ${{ github.workspace }}/parent/social_data_commons/
- uses: r-lib/actions/setup-r@v2
- name: Cache renv dependencies
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/parent/social_data_commons/renv
key: ${{ runner.os }}-renv
restore-keys: |
${{ runner.os }}-renv
- name: Cache renv dependencies
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/parent/${{ github.event.repository.name }}/renv
key: ${{ runner.os }}-renv
restore-keys: |
${{ runner.os }}-renv
- name: Cache downloaded repositories
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/parent/social_data_commons/repos
key: ${{ runner.os }}-repos
restore-keys: |
${{ runner.os }}-repos
- name: Run tree
run: |
tree ..
- name: Installing dependencies (needed to download things)
run: |
sudo apt-get install libcurl4-openssl-dev
- run: echo "💡 The ${{ github.repository }} repository have been cloned to the runner."
- name: Set up "data commons"
working-directory: ${{ github.workspace }}/parent/social_data_commons
shell: Rscript {0}
run: |
print(.libPaths()) # print install paths to debug erros
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv")
renv::init()
renv::restore()
install.packages('vroom')
remotes::install_github('uva-bi-sdad/community')
library(community)
# Printing all installed packages
ip = as.data.frame(installed.packages()[,c(1,3:4)])
ip = ip[is.na(ip$Priority),1:2,drop=FALSE]
print(ip)
source("build.R")
datacommons_view(
"../social_data_commons", "${{ github.event.repository.name }}",
metadata = entities, entity_info = NULL, formatters = list(region_name = function(x) sub(",.*$", "", x))
)
- name: build ${{ github.event.repository.name }}
working-directory: ${{ github.workspace }}/parent/${{ github.event.repository.name }}
shell: Rscript {0}
run: |
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv")
renv::restore()
install.packages('remotes')
remotes::install_github('uva-bi-sdad/community')
source("build.R")
renv::snapshot()
- name: Run tree (for debugging)
run: |
tree ..
- name: Commit files # Commit changes. You need to do this so child sites work...
working-directory: parent/${{ github.event.repository.name }}
run: |
ls -la
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git add -A
git commit -m "generating dashboard"
git push
# - name: Setup Pages
# uses: actions/configure-pages@v4
# - name: Upload artifact
# uses: actions/upload-artifact@v4
# with:
# # Upload entire repository
# path: 'parent/${{ github.event.repository.name }}/docs'
# - name: Deploy to GitHub Pages
# id: deployment
# uses: actions/deploy-pages@v4