|
1 | 1 | name: Render and Publish Book |
2 | 2 |
|
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. |
7 | 15 |
|
8 | 16 | on: |
9 | 17 | push: |
|
14 | 22 | permissions: |
15 | 23 | contents: write |
16 | 24 |
|
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). |
18 | 27 | concurrency: |
19 | 28 | group: publish-${{ github.ref }} |
20 | 29 | cancel-in-progress: true |
21 | 30 |
|
22 | 31 | 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] |
25 | 38 |
|
26 | 39 | steps: |
27 | 40 | - name: Check out repository |
|
43 | 56 | with: |
44 | 57 | # The attendee install line is install.packages(c("CVXR","scip","Uno", |
45 | 58 | # "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 |
47 | 60 | # required system libraries (e.g. gfortran for Uno's rmumps dependency). |
48 | 61 | packages: | |
49 | 62 | any::rmarkdown |
|
67 | 80 | - name: Render book (HTML) |
68 | 81 | run: quarto render --to html |
69 | 82 |
|
| 83 | + # Deploy only from the Linux leg; mac/Windows are render-only checks. |
70 | 84 | - name: Publish to gh-pages |
| 85 | + if: matrix.os == 'ubuntu-latest' |
71 | 86 | uses: quarto-dev/quarto-actions/publish@v2 |
72 | 87 | with: |
73 | 88 | target: gh-pages |
|
0 commit comments