-
Notifications
You must be signed in to change notification settings - Fork 2
110 lines (92 loc) · 2.96 KB
/
QuartoBuildPublish.yml
File metadata and controls
110 lines (92 loc) · 2.96 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
name: Build and Publish Quarto Presentation
on:
pull_request:
paths:
- '.github/workflows/QuartoBuildPublish.yml'
- 'presentations/intro-julia/**'
push:
branches:
- main
paths:
- '.github/workflows/QuartoBuildPublish.yml'
- 'presentations/intro-julia/**'
workflow_dispatch:
concurrency:
# Skip intermediate builds: all builds except for builds on the `main` branch
# Cancel intermediate builds: only pull request builds
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
build-publish-quarto:
timeout-minutes: 20
permissions:
contents: write
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: presentations/intro-julia
steps:
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@v2
- name: Load Julia packages from cache
id: julia-cache
uses: julia-actions/cache@v2
- name: Install dependencies
shell: julia --color=yes --project {0}
run: |
using Pkg: Pkg
Pkg.instantiate()
- name: Render HTML presentation
# Presentation will be rendered when publishing, no need to do it twice.
if: github.event_name == 'pull_request'
shell: julia --color=yes --project {0}
run: |
using quarto_jll: quarto
run(`$(quarto()) render index.qmd`)
- name: Configure Git
if: github.event_name != 'pull_request'
run: |
git config user.name "${{github.actor}}"
git config user.email "${{github.actor_id}}+${{github.actor}}@users.noreply.github.com"
- name: Render and publish HTML presentation
shell: julia --color=yes --project {0}
if: github.event_name != 'pull_request'
run: |
using quarto_jll: quarto
run(`$(quarto()) publish --no-prompt --no-browser gh-pages index.qmd`)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install TinyTeX
shell: julia --color=yes --project {0}
run: |
using quarto_jll: quarto
run(`$(quarto()) install tinytex`)
- name: Render PDF presentation
shell: julia --color=yes --project {0}
run: |
using quarto_jll: quarto
run(`$(quarto()) render index.qmd --to pdf`)
- name: Upload PDF presentation
uses: actions/upload-artifact@v7
with:
name: pdf-presentation
path: |
**/index.pdf
retention-days: 30
- name: Upload HTML presentation
uses: actions/upload-artifact@v7
with:
name: html-presentation
path: |
**/index.html
**/index_files
retention-days: 30
- name: Save Julia depot cache on cancel or failure
id: julia-cache-save
if: cancelled() || failure()
uses: actions/cache/save@v5
with:
path: |
${{ steps.julia-cache.outputs.cache-paths }}
key: ${{ steps.julia-cache.outputs.cache-key }}