diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cfbd390..acad88d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,71 +4,74 @@ name: deploy-book on: push: branches: - - main + - main # This job installs dependencies, build the book, and pushes it to `gh-pages` jobs: deploy-book: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - # Install dependencies - - name: Setup Miniconda - uses: conda-incubator/setup-miniconda@v2 - with: - activate-environment: phys139 - environment-file: notebooks/environment.yml - python-version: 3.9 - auto-activate-base: false + # Install dependencies + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v3 + with: + miniforge-version: latest + use-mamba: true + channels: conda-forge + activate-environment: phys139 + environment-file: notebooks/environment.yml + python-version: 3.10.10 + auto-activate-base: false - # Check dependencies - - name: Check Miniconda - shell: bash -l {0} - run: | - conda info - conda list - conda config --show-sources - conda config --show - printenv | sort + # Check dependencies + - name: Check Miniconda + shell: bash -l {0} + run: | + conda info + conda list + conda config --show-sources + conda config --show + printenv | sort - - name: Build the book - shell: bash -l {0} - run: | - jupyter contrib nbextension install --user - jupyter nbextension enable --py widgetsnbextension - jupyter-book build notebooks + - name: Build the book + shell: bash -l {0} + run: | + jupyter contrib nbextension install --user + jupyter nbextension enable --py widgetsnbextension + jupyter-book build notebooks - - name: Compile LaTeX - uses: docker://xucheng/texlive-full:latest - with: - entrypoint: /bin/sh - args: | - -c "\ - cd syllabus && \ - latexmk && \ - cd ../homeworks/homework_1 && \ - pdflatex homework_1 && \ - cd ../homework_2 && \ - pdflatex homework_2 && \ - cd ../homework_3 && \ - pdflatex homework_3 && \ - cd ../homework_4 && \ - pdflatex homework_4" + - name: Compile LaTeX + uses: docker://xucheng/texlive-full:latest + with: + entrypoint: /bin/sh + args: | + -c "\ + cd syllabus && \ + latexmk && \ + cd ../homeworks/homework_1 && \ + pdflatex homework_1 && \ + cd ../homework_2 && \ + pdflatex homework_2 && \ + cd ../homework_3 && \ + pdflatex homework_3 && \ + cd ../homework_4 && \ + pdflatex homework_4" - - name: Copy syllabus and homework for deployment - run: | - cp syllabus/syllabus.pdf notebooks/_build/html/syllabus.pdf && \ - cp homeworks/homework_1/homework_1.pdf notebooks/_build/html/homework_1.pdf && \ - cp homeworks/homework_2/homework_2.pdf notebooks/_build/html/homework_2.pdf && \ - cp homeworks/homework_3/homework_3.pdf notebooks/_build/html/homework_3.pdf && \ - cp homeworks/homework_4/homework_4.pdf notebooks/_build/html/homework_4.pdf + - name: Copy syllabus and homework for deployment + run: | + cp syllabus/syllabus.pdf notebooks/_build/html/syllabus.pdf && \ + cp homeworks/homework_1/homework_1.pdf notebooks/_build/html/homework_1.pdf && \ + cp homeworks/homework_2/homework_2.pdf notebooks/_build/html/homework_2.pdf && \ + cp homeworks/homework_3/homework_3.pdf notebooks/_build/html/homework_3.pdf && \ + cp homeworks/homework_4/homework_4.pdf notebooks/_build/html/homework_4.pdf - - name: GitHub Pages action - uses: peaceiris/actions-gh-pages@v3.9.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: notebooks/_build/html - force_orphan: true - user_name: 'github-actions[bot]' - user_email: 'github-actions[bot]@users.noreply.github.com' + - name: GitHub Pages action + uses: peaceiris/actions-gh-pages@v3.9.3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: notebooks/_build/html + force_orphan: true + user_name: "github-actions[bot]" + user_email: "github-actions[bot]@users.noreply.github.com" diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 05e3e25..bdf15bb 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -3,29 +3,24 @@ name: build-and-push on: push: branches: - - 'main' + - "main" jobs: docker: runs-on: ubuntu-latest steps: - - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up QEMU + - name: Checkout + uses: actions/checkout@v3 + - name: Set up QEMU uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - - name: Login to DockerHub + - name: Login to DockerHub uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push + - name: Build and push uses: docker/build-push-action@v2 with: context: .