Merge pull request #98 from devitocodes/devito #1
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
| name: Publish Book | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: # Allow manual triggers | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| cache: 'pip' | |
| - name: Set up Quarto | |
| uses: quarto-dev/quarto-actions/setup@v2 | |
| with: | |
| version: '1.6.40' | |
| - name: Install TeX Live | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| texlive-latex-base \ | |
| texlive-latex-recommended \ | |
| texlive-latex-extra \ | |
| texlive-fonts-recommended \ | |
| texlive-fonts-extra \ | |
| texlive-science \ | |
| texlive-pictures \ | |
| texlive-bibtex-extra \ | |
| texlive-plain-generic \ | |
| lmodern \ | |
| biber \ | |
| latexmk \ | |
| cm-super \ | |
| dvipng \ | |
| ghostscript | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install numpy scipy matplotlib sympy jupyter | |
| - name: Build HTML | |
| run: quarto render --to html | |
| - name: Build PDF | |
| run: quarto render --to pdf | |
| - name: Copy PDF to HTML output | |
| run: | | |
| cp _book/Finite-Difference-Computing-with-PDEs.pdf _book/book.pdf | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: _book | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |