-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (78 loc) · 2.21 KB
/
gh-pages.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
name: Publish Site
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'presentation/**'
- 'paper/**'
- 'frontpage/**'
jobs:
publish:
name: Build & Deploy Quarto Projects
runs-on: ubuntu-latest
container:
image: rocker/tidyverse:latest
permissions:
contents: write
strategy:
max-parallel: 1
matrix:
QUARTO_DIR:
- presentation
- paper
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Install tinytex
run: quarto install tinytex
shell: bash
- name: Render Quarto Project
run: quarto render --output-dir _site
shell: bash
working-directory: ${{ matrix.QUARTO_DIR }}
- name: Publish ${{ matrix.QUARTO_DIR }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./${{ matrix.QUARTO_DIR }}/_site
destination_dir: ${{ matrix.QUARTO_DIR }}
keep_files: true
index:
name: Index page
needs: publish
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Publish index page
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./frontpage
keep_files: true
pdf-presentation:
name: Presentation as PDF
needs: index
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Setup Chrome
uses: browser-actions/setup-chrome@v1
- name: Print presentation as PDF
run: |
mkdir -p /tmp/presentation
chrome --headless --disable-gpu \
--print-to-pdf=/tmp/presentation/index.pdf \
https://${GITHUB_REPOSITORY_OWNER}.github.io/${{ github.event.repository.name }}/presentation/index.html?print-pdf
- name: Publish PDF presentation
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: /tmp/presentation
keep_files: true
destination_dir: presentation