Skip to content

Commit a826af6

Browse files
committed
Automating rendering
1 parent 6aeeb25 commit a826af6

File tree

9 files changed

+93
-1
lines changed

9 files changed

+93
-1
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: deploy-landing-page
2+
3+
# Only run this when the master branch changes
4+
on:
5+
push:
6+
branches:
7+
- branch-R
8+
workflow_dispatch:
9+
10+
# This job installs dependencies, builds the book, and pushes it to `gh-pages`
11+
jobs:
12+
13+
compile-project:
14+
runs-on: ubuntu-22.04
15+
steps:
16+
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
20+
- name: Setup Pages
21+
id: pages
22+
uses: actions/configure-pages@v3
23+
24+
- name: Install R
25+
uses: r-lib/actions/setup-r@v2
26+
with:
27+
r-version: '4.4.2'
28+
29+
- name: Render Project
30+
run: |
31+
./render.sh
32+
33+
- name: Upload Artifact
34+
uses: actions/[email protected]
35+
with:
36+
path: .
37+
38+
publish:
39+
needs: compile-project
40+
41+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
42+
permissions:
43+
pages: write # to deploy to Pages
44+
id-token: write # to verify the deployment originates from an appropriate source
45+
46+
# Deploy to the github-pages environment
47+
environment:
48+
name: github-pages
49+
url: ${{ steps.deployment.outputs.page_url }}
50+
51+
# Specify runner + deployment step
52+
runs-on: ubuntu-latest
53+
steps:
54+
- name: Deploy to GitHub Pages
55+
id: deployment
56+
uses: actions/deploy-pages@v4

99-links.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
# Impressum
3+
4+
- This document can be found at <`r WEBSITE_URL`>
5+
- This document's source: <`r GITHUB_REPOSITORY`>
6+
- Licensed under [![CC BY-NC 4.0](images/cc-by-nc-80x15.png)](https://creativecommons.org/licenses/by-nc/4.0/)

README.Rmd

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ output:
1212
knitr::opts_chunk$set(echo = TRUE)
1313
NOTE <- "README ::::"
1414
options(scipen = 999)
15+
GITHUB_REPOSITORY <- Sys.getenv("GITHUB_REPOSITORY")
16+
GITHUB_REPOSITORY_PARTS <- strsplit(GITHUB_REPOSITORY, "/")[[1]]
17+
REPOSITORY_URL <- paste0("https://github.com/", GITHUB_REPOSITORY)
18+
WEBSITE_URL <- paste0("https://", GITHUB_REPOSITORY_PARTS[1], ".github.io/", GITHUB_REPOSITORY_PARTS[2])
19+
1520
```
1621

1722
## Introduction
@@ -250,3 +255,8 @@ but subsequent runs will show the output
250255
```
251256
README :::: Re-using existing file with vintage =2017-06-01
252257
```
258+
259+
260+
```{r, child=c('99-links.md')}
261+
```
262+

README.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,13 @@ <h3>Example implementation of caching</h3>
682682
</div>
683683
</div>
684684
</div>
685+
<div id="impressum" class="section level1">
686+
<h1>Impressum</h1>
687+
<ul>
688+
<li>This document’s source: &lt;&gt;</li>
689+
<li>Licensed under <a href="https://creativecommons.org/licenses/by-nc/4.0/"><img role="img" aria-label="CC BY-NC 4.0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAPCAMAAABEF7i9AAAABGdBTUEAANbY1E9YMgAAAJZQTFRFAAAARERE7u7ud3d3lJmTDg4OERERZmZmMzMzDQ4NW15bDQ0NfYJ9cnZx3d3dMTMxhoaGJygnZ2tnOz07ISEhOTs5QUJBGRkZQkJCJCUjICAgDQ0MxsrGs7iyh4eHLjAuQ0NDxcbFj5CPS0xLyMzIgICADxAPur+6ys7KmZmZqqqqu7u7VVVVIiIiiIiIzMzMq7Gq////+Wgu+gAAAMlJREFUeNqtlNcOgzAMRZ0E6N57712C7///XItkIt6gJUd5SWQd3TiD/AOvpEJOGZKVJRUGzPcr/YUTBqFFhhow3y4VhaMxHAk1mc+nasKGRRKT0oriBKrHfD9Kf6UoV08EFAnb9EL8hjGRfjxhGsy3A32BjEyAbIYCYYcSTRZ41wHAhMybtSR0ZSITfbmEqhZp84BpuYT5Dcu8VEJuWTwjqmlF9S72O9dDl/DHHvJk6fmUg9UWGfOFh3vIHeqLbzqr+lK84v+v+QBzPE1kQ/1QEQAAAABJRU5ErkJggg==" alt="CC BY-NC 4.0" /></a></li>
690+
</ul>
691+
</div>
685692
<div class="footnotes footnotes-end-of-document">
686693
<hr />
687694
<ol>

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,3 +351,13 @@ but subsequent runs will show the output
351351
```
352352
README :::: Re-using existing file with vintage =2017-06-01
353353
```
354+
355+
356+
357+
358+
# Impressum
359+
360+
361+
- This document's source: <>
362+
- Licensed under [![CC BY-NC 4.0](images/cc-by-nc-80x15.png)](https://creativecommons.org/licenses/by-nc/4.0/)
363+

images/cc-by-nc-80x15.png

436 Bytes
Loading

images/ccby80x15.png

3.88 KB
Loading

render.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ docker run --rm \
66
-v "$(pwd):/work" \
77
-w /work \
88
rocker/tidyverse:4.4.3 \
9-
Rscript -e "rmarkdown::render('README.Rmd')"
9+
run.sh

run.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
Rscript -e "rmarkdown::render('README.Rmd')"

0 commit comments

Comments
 (0)