|
| 1 | +name: Render and Publish Book |
| 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. |
| 7 | + |
| 8 | +on: |
| 9 | + push: |
| 10 | + branches: [master] |
| 11 | + workflow_dispatch: |
| 12 | + |
| 13 | +# Allow the built-in GITHUB_TOKEN to push the rendered site to gh-pages. |
| 14 | +permissions: |
| 15 | + contents: write |
| 16 | + |
| 17 | +# Never run two deploys against the same ref at once. |
| 18 | +concurrency: |
| 19 | + group: publish-${{ github.ref }} |
| 20 | + cancel-in-progress: true |
| 21 | + |
| 22 | +jobs: |
| 23 | + build-deploy: |
| 24 | + runs-on: ubuntu-latest |
| 25 | + |
| 26 | + steps: |
| 27 | + - name: Check out repository |
| 28 | + uses: actions/checkout@v4 |
| 29 | + |
| 30 | + - name: Set up Quarto |
| 31 | + uses: quarto-dev/quarto-actions/setup@v2 |
| 32 | + with: |
| 33 | + version: release |
| 34 | + |
| 35 | + - name: Set up R |
| 36 | + uses: r-lib/actions/setup-r@v2 |
| 37 | + with: |
| 38 | + r-version: release |
| 39 | + use-public-rspm: true |
| 40 | + |
| 41 | + - name: Install R package dependencies |
| 42 | + uses: r-lib/actions/setup-r-dependencies@v2 |
| 43 | + with: |
| 44 | + # The attendee install line is install.packages(c("CVXR","scip","Uno", |
| 45 | + # "sparsediff")); CVXR pulls clarabel/osqp/scs/highs automatically. The |
| 46 | + # rest are the helper packages the chapters library(). pak resolves the |
| 47 | + # required system libraries (e.g. gfortran for Uno's rmumps dependency). |
| 48 | + packages: | |
| 49 | + any::rmarkdown |
| 50 | + any::knitr |
| 51 | + any::CVXR |
| 52 | + any::scip |
| 53 | + any::Uno |
| 54 | + any::sparsediff |
| 55 | + any::ggplot2 |
| 56 | + any::tidyr |
| 57 | + any::glmnet |
| 58 | + any::nnls |
| 59 | + any::boot |
| 60 | + any::bench |
| 61 | + any::png |
| 62 | + any::RColorBrewer |
| 63 | + any::expm |
| 64 | + any::MASS |
| 65 | + any::Matrix |
| 66 | +
|
| 67 | + - name: Render book (HTML) |
| 68 | + run: quarto render --to html |
| 69 | + |
| 70 | + - name: Publish to gh-pages |
| 71 | + uses: quarto-dev/quarto-actions/publish@v2 |
| 72 | + with: |
| 73 | + target: gh-pages |
| 74 | + render: false |
| 75 | + env: |
| 76 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments