Skip to content

Commit f44fe1e

Browse files
committed
ci: render on ubuntu/macOS/Windows, deploy only from ubuntu
Matrix over the three OSes attendees use. ubuntu renders + deploys to gh-pages; macOS and Windows are render-only cross-platform checks. fail-fast off so a red mac/Windows leg never blocks the deploy.
1 parent 8e2d586 commit f44fe1e

1 file changed

Lines changed: 23 additions & 8 deletions

File tree

.github/workflows/publish.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
name: Render and Publish Book
22

3-
# Render the Quarto book on a clean Ubuntu runner and deploy the HTML site to
4-
# the gh-pages branch. Packages are installed straight from CRAN/P3M, mirroring
5-
# the attendee install line -- so a green build proves the tutorial reproduces
6-
# off the author's machine.
3+
# Render the Quarto book on clean runners installing packages straight from
4+
# CRAN/P3M -- the same line attendees run -- so a green build proves the
5+
# tutorial reproduces off the author's macOS box.
6+
#
7+
# * ubuntu-latest : render AND deploy the HTML site to gh-pages
8+
# * macos-latest : render only (cross-platform check, no deploy)
9+
# * windows-latest : render only (cross-platform check, no deploy)
10+
#
11+
# ubuntu is the most different from the author's machine, so it catches the
12+
# most "works on my machine" drift; mac/Windows cover the OSes attendees
13+
# actually use. fail-fast is off so a red mac/Windows leg never blocks the
14+
# ubuntu deploy.
715

816
on:
917
push:
@@ -14,14 +22,19 @@ on:
1422
permissions:
1523
contents: write
1624

17-
# Never run two deploys against the same ref at once.
25+
# A newer push supersedes an in-progress run (does not cancel matrix legs of
26+
# the same run).
1827
concurrency:
1928
group: publish-${{ github.ref }}
2029
cancel-in-progress: true
2130

2231
jobs:
23-
build-deploy:
24-
runs-on: ubuntu-latest
32+
build:
33+
runs-on: ${{ matrix.os }}
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
os: [ubuntu-latest, macos-latest, windows-latest]
2538

2639
steps:
2740
- name: Check out repository
@@ -43,7 +56,7 @@ jobs:
4356
with:
4457
# The attendee install line is install.packages(c("CVXR","scip","Uno",
4558
# "sparsediff")); CVXR pulls clarabel/osqp/scs/highs automatically. The
46-
# rest are the helper packages the chapters library(). pak resolves the
59+
# rest are the helper packages the chapters library(). pak resolves any
4760
# required system libraries (e.g. gfortran for Uno's rmumps dependency).
4861
packages: |
4962
any::rmarkdown
@@ -67,7 +80,9 @@ jobs:
6780
- name: Render book (HTML)
6881
run: quarto render --to html
6982

83+
# Deploy only from the Linux leg; mac/Windows are render-only checks.
7084
- name: Publish to gh-pages
85+
if: matrix.os == 'ubuntu-latest'
7186
uses: quarto-dev/quarto-actions/publish@v2
7287
with:
7388
target: gh-pages

0 commit comments

Comments
 (0)