-
Notifications
You must be signed in to change notification settings - Fork 0
204 lines (152 loc) · 5.67 KB
/
Copy pathupdate_content.yaml
File metadata and controls
204 lines (152 loc) · 5.67 KB
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# Update the content on a daily basis
on:
push:
paths:
- .github/workflows/update_content.yaml
- docs/compute_1.md
# Do not do docs/compute_2.md: that one is generated by this script
- docs/courses_1.md
# Do not do docs/courses_2.md: that one is generated by this script
- docs/index_1.md
# Do not do docs/index_2.md: that one is generated by this script
- docs/other_1.md
# Do not do docs/other_2.md: that one is generated by this script
- docs/storage_1.md
# Do not do docs/storage_2.md: that one is generated by this script
- docs/web_host_1.md
# Do not do docs/web_host_2.md: that one is generated by this script
- scripts/create_compute_page.sh
- scripts/create_courses_page.sh
- scripts/create_index_page.sh
- scripts/create_other_page.sh
- scripts/create_storage_page.sh
- scripts/create_web_host_page.sh
schedule:
- cron: "0 0 * * *" # Run daily
name: Update content
jobs:
update_content:
runs-on: ubuntu-latest
permissions:
contents: write
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
#- uses: r-lib/actions/setup-pandoc@v2
- name: Install libcurl4-openssl-dev
run: sudo apt install -qq libcurl4-openssl-dev
- name: Install libharfbuzz-dev libfribidi-dev
run: sudo apt install -qq libharfbuzz-dev libfribidi-dev
- name: Install dependencies
run: |
install.packages(c("remotes", "rcmdcheck"))
remotes::install_cran("dplyr")
remotes::install_cran("knitr")
remotes::install_cran("lubridate")
remotes::install_cran("readr")
remotes::install_cran("stringr")
remotes::install_cran("testthat")
remotes::install_cran("tibble")
remotes::install_cran("tidyr")
remotes::install_github("richelbilderbeek/scoreto")
shell: Rscript {0}
##########################
# Compute
##########################
- name: Create docs/compute_2.md
run: Rscript -e 'scoreto::get_compute_as_markdown()' > docs/compute_2.md
- name: View compute_2.md
run: cat docs/compute_2.md
- name: Create docs/compute.md
run: ./scripts/create_compute_page.sh
- name: View docs/compute.md
run: cat docs/compute.md
##########################
# Courses
##########################
- name: Create docs/courses_2.md
run: Rscript -e 'scoreto::get_courses_as_markdown()' > docs/courses_2.md
- name: View courses_2.md
run: cat docs/courses_2.md
- name: Create docs/courses.md
run: ./scripts/create_courses_page.sh
- name: View docs/courses.md
run: cat docs/courses.md
- name: Create docs/courses.csv
run: Rscript -e 'scoreto::save_courses_as_csv("docs/courses.csv")'
- name: View docs/courses.csv
run: cat docs/courses.csv
##########################
# Index
##########################
- name: Create docs/index_2.md
run: Rscript -e 'scoreto::get_all_provider_logos_as_markdown()' > docs/index_2.md
- name: View index_2.md
run: cat docs/index_2.md
- name: Create docs/index.md
run: ./scripts/create_index_page.sh
- name: View docs/index.md
run: cat docs/index.md
##########################
# Other
##########################
- name: Create docs/other_2.md
run: Rscript -e 'scoreto::get_other_as_markdown()' > docs/other_2.md
- name: View other_2.md
run: cat docs/other_2.md
- name: Create docs/other.md
run: ./scripts/create_other_page.sh
- name: View docs/other.md
run: cat docs/other.md
##########################
# Storage
##########################
- name: Create docs/storage_2.md
run: Rscript -e 'scoreto::get_storage_as_markdown()' > docs/storage_2.md
- name: View storage_2.md
run: cat docs/storage_2.md
- name: Create docs/storage.md
run: ./scripts/create_storage_page.sh
- name: View docs/storage.md
run: cat docs/storage.md
##########################
# Web host
##########################
- name: Create docs/web_host_2.md
run: Rscript -e 'scoreto::get_web_host_as_markdown()' > docs/web_host_2.md
- name: View web_host_2.md
run: cat docs/web_host_2.md
- name: Create docs/web_host.md
run: ./scripts/create_web_host_page.sh
- name: View docs/web_host.md
run: cat docs/web_host.md
##########################
# Done with generating content
##########################
- name: View changes, if any
run: git status
- name: If no changes, we are done
run: |
# From https://stackoverflow.com/a/25149786/3364162
if [[ $(git status --porcelain) ]]; then
echo "Changes have been made"
else
echo "No changes have been made. Done!"
fi
# Cannot get this to work here, maybe for the better
#
# git pull --no-edit --rebase=true
#
- name: Add and commit changes, if any
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "Update content" || true
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}