-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (73 loc) · 2.96 KB
/
deploy-page.yml
File metadata and controls
83 lines (73 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
name: Deploy slides to GitHub Pages
on:
push:
branches: [main]
paths:
- "config/**"
- "workshops/**"
- "assets/**"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
env:
QUARTO_CACHE_DIR: ${{ github.workspace }}/.quarto-cache
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache Quarto cache and libs
uses: actions/cache@v4
with:
path: |
.quarto-cache
~/.cache/quarto
key: ${{ runner.os }}-quarto-${{ hashFiles('config/_quarto.yml', 'config/slides/index.qmd', 'workshops/fundamentals/index.qmd', 'workshops/loops-and-functions/index.qmd', 'workshops/exploratory-data-analysis/index.qmd', 'config/slides/theme/**') }}
restore-keys: |
${{ runner.os }}-quarto-
- name: Setup Quarto
uses: quarto-dev/quarto-actions/setup@v2
with:
version: 1.6.40
- name: Render slides
run: |
cd config
quarto render slides/index.qmd
quarto render ../workshops/fundamentals/index.qmd --to revealjs
quarto render ../workshops/loops-and-functions/index.qmd --to revealjs
quarto render ../workshops/exploratory-data-analysis/index.qmd --to revealjs
- name: Assemble Pages site
run: |
rm -rf site
mkdir -p site
cp config/slides/index.html site/index.html
rsync -av config/slides/index_files/ site/index_files/ 2>/dev/null || true
rsync -av assets/ site/assets/
rsync -av workshops/fundamentals/ site/fundamentals/ --exclude "*.ipynb" --exclude "*.qmd"
rsync -av workshops/loops-and-functions/ site/loops-and-functions/ --exclude "*.ipynb" --exclude "*.qmd"
rsync -av workshops/exploratory-data-analysis/ site/exploratory-data-analysis/ --exclude "*.ipynb" --exclude "*.qmd"
# Landing page: fix logo path (../../assets/ -> assets/)
sed -i.bak 's|../../assets/|assets/|g' site/index.html && rm -f site/index.html.bak
# Workshop pages: fix asset paths (../../assets/ -> ../assets/) so they load from site/fundamentals/ etc.
sed -i.bak 's|../../assets/|../assets/|g' site/fundamentals/index.html site/loops-and-functions/index.html site/exploratory-data-analysis/index.html 2>/dev/null || true
rm -f site/fundamentals/index.html.bak site/loops-and-functions/index.html.bak site/exploratory-data-analysis/index.html.bak 2>/dev/null || true
- name: Upload Pages artifact (site root)
uses: actions/upload-pages-artifact@v3
with:
path: site
deploy:
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4