Skip to content

Commit c4a7cef

Browse files
committed
Add GitHub CI to build and deploy slides
Used https://github.com/Cambridge-ICCS/Summer-school-Intro-Git as reference
1 parent 4bb4bdf commit c4a7cef

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Build and deploy slides
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
push:
7+
branches: [ "main" ]
8+
9+
# Allows manual run
10+
workflow_dispatch:
11+
12+
jobs:
13+
# Builds slides with quarto and deploys them to a branch
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Quarto
22+
uses: quarto-dev/quarto-actions/setup@v2
23+
24+
- name: Render Quarto Project
25+
run: |
26+
cd src
27+
quarto render slides.qmd
28+
cd ../
29+
30+
- name: Test pages build
31+
if: github.ref != 'refs/heads/main'
32+
uses: JamesIves/github-pages-deploy-action@v4
33+
with:
34+
branch: test-pages
35+
folder: src
36+
dry-run: true
37+
38+
- name: Deploy pages for main
39+
if: github.ref == 'refs/heads/main'
40+
uses: JamesIves/github-pages-deploy-action@v4
41+
with:
42+
branch: gh-pages
43+
folder: src

0 commit comments

Comments
 (0)