-
-
Notifications
You must be signed in to change notification settings - Fork 7
69 lines (66 loc) · 2.2 KB
/
publish.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
on:
push:
branches: main
workflow_dispatch:
name: Quarto Publish
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
build-deploy:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: |
sysfonts
ggplot2
ggtext
showtext
knitr
webshot2
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Render and Publish
run: |
[ -d index ] || mkdir index
if grep -E "^index/$" .gitignore ; then
echo "index already in .gitignore"
else
echo "Add index to .gitignore"
echo "\nindex/" >> .gitignore
fi
cd index
quarto use template --no-prompt ${{ github.repository }}
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git config --global user.name "${{ github.actor }}"
quarto publish gh-pages index.qmd
cd ..
Rscript -e "webshot2::webshot(url = \"index/index.html\", file = \"template.png\", vwidth = 1920, vheight = 1080)"
rm -rf index
# git add template.png
# git commit -m "ci: update thumbs" || echo "No changes to commit"
# git push origin || echo "No changes to commit"
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
add-paths: template.png
commit-message: "ci: update thumbs"
signoff: false
branch: ci/latest-quarto-updates
delete-branch: true
title: "ci: update thumbs"
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
committer: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
- name: Render and Publish
if: ${{ false }}
uses: quarto-dev/quarto-actions/publish@v2
with:
target: gh-pages
path: template.qmd