build-book #97
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| inputs: | |
| publish: | |
| description: 'publish the book to github pages for connect cloud deployment' | |
| required: false | |
| default: false | |
| type: boolean | |
| name: build-book | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Setup R | |
| uses: r-lib/actions/setup-r@v2 | |
| with: | |
| use-public-rspm: true | |
| - name: Setup pandoc | |
| uses: r-lib/actions/setup-pandoc@v2 | |
| with: | |
| pandoc-version: '2.17.1.1' | |
| - name: Install TinyTeX | |
| uses: r-lib/actions/setup-tinytex@v2 | |
| env: | |
| # install full prebuilt version | |
| TINYTEX_INSTALLER: TinyTeX | |
| - uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| needs: book | |
| - name: Install missing system dependencies | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get install -y libgtk2.0-dev asymptote | |
| - name: Build book | |
| run: make all | |
| - name: Deploy to gh-pages | |
| if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| branch: gh-pages | |
| folder: _book | |
| clean: true | |
| single-commit: true | |
| dry-run: ${{ (github.event_name == 'workflow_dispatch' && (github.event.inputs.publish == 'false' || github.event.inputs.publish == false)) || false }} | |
| - name: Upload book folder for debug | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: book-dir | |
| path: _book |