|
| 1 | +# Simple workflow for deploying static content to GitHub Pages |
| 2 | +name: Deploy static content to Pages |
| 3 | + |
| 4 | +on: |
| 5 | + # Runs on pushes targeting the default branch |
| 6 | + push: |
| 7 | + branches: ["main"] |
| 8 | + |
| 9 | + # Allows you to run this workflow manually from the Actions tab |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
| 13 | +permissions: |
| 14 | + contents: read |
| 15 | + pages: write |
| 16 | + id-token: write |
| 17 | + |
| 18 | +# Allow one concurrent deployment |
| 19 | +concurrency: |
| 20 | + group: "pages" |
| 21 | + cancel-in-progress: true |
| 22 | + |
| 23 | +jobs: |
| 24 | + # Single deploy job since we're just deploying |
| 25 | + deploy: |
| 26 | + environment: |
| 27 | + name: github-pages |
| 28 | + url: ${{ steps.deployment.outputs.page_url }} |
| 29 | + runs-on: ubuntu-latest |
| 30 | + steps: |
| 31 | + # - name: Harden Runner |
| 32 | + # uses: step-security/harden-runner@main |
| 33 | + # with: |
| 34 | + # egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs |
| 35 | + - name: Checkout |
| 36 | + uses: actions/checkout@main |
| 37 | + - name: 🐍 Set up Python |
| 38 | + uses: actions/setup-python@main |
| 39 | + with: |
| 40 | + python-version: "3.12" |
| 41 | + cache: "pip" |
| 42 | + cache-dependency-path: "pyproject.toml" |
| 43 | + - name: Install system dependencies |
| 44 | + run: | |
| 45 | + sudo apt update && sudo apt install -y \ |
| 46 | + pkg-config libcairo-dev libpango1.0-dev wget fonts-roboto |
| 47 | + wget -qO- "https://yihui.org/tinytex/install-bin-unix.sh" | sh |
| 48 | + echo ${HOME}/.TinyTeX/bin/x86_64-linux >> $GITHUB_PATH |
| 49 | + - name: Install LaTeX and Python dependencies |
| 50 | + run: | |
| 51 | + tlmgr update --self |
| 52 | + tlmgr install \ |
| 53 | + babel-english ctex doublestroke dvisvgm frcursive fundus-calligra jknapltx \ |
| 54 | + mathastext microtype physics preview ragged2e relsize rsfs setspace standalone \ |
| 55 | + wasy wasysym |
| 56 | +
|
| 57 | + - name: 🔧 Build HTML |
| 58 | + run: | |
| 59 | + sudo apt-get install graphviz |
| 60 | + sudo apt-get update && sudo apt-get upgrade |
| 61 | + sudo apt install build-essential python3-dev libcairo2-dev libpango1.0-dev ffmpeg |
| 62 | + pip install --upgrade pip |
| 63 | + conda install -c conda-forge box2d-py |
| 64 | + pip install taolib |
| 65 | + pip install -e .[linkify,rtd] --upgrade |
| 66 | + conda install -c conda-forge pandoc compilers cppyy |
| 67 | + conda install -c conda-forge ffmpeg manim |
| 68 | + pip install manim |
| 69 | + invoke doc |
| 70 | + - name: Setup Pages |
| 71 | + uses: actions/configure-pages@main |
| 72 | + - name: Upload artifact |
| 73 | + uses: actions/upload-pages-artifact@main |
| 74 | + with: |
| 75 | + # Upload entire repository |
| 76 | + path: 'docs/build/html/' |
| 77 | + - name: 🚀 Deploy to GitHub Pages |
| 78 | + id: deployment |
| 79 | + uses: actions/deploy-pages@main |
| 80 | + # uses: peaceiris/[email protected] |
0 commit comments