From d0d29d61428819e6238984751adf62f91a0a0052 Mon Sep 17 00:00:00 2001 From: Skandan Chandrasekar Date: Mon, 12 Dec 2022 14:52:54 -0500 Subject: [PATCH] Add flows --- .github/workflows/pages.yml | 64 ++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 8fc01b1..8f08f52 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -1,41 +1,39 @@ -name: Sphinx docs to gh-pages +name: deploy-book +# Only run this when the master branch changes on: push: branches: - - main - workflow_dispatch: + - main + paths: + - bootcamp/** +# This job installs dependencies, builds the book, and pushes it to `gh-pages` jobs: - sphinx_docs_to_gh-pages: + deploy-book: runs-on: ubuntu-latest - name: Sphinx docs to gh-pages steps: - - name: Cancel Workflow Action - uses: styfle/cancel-workflow-action@0.11.0 - - uses: actions/checkout@v3 - - uses: conda-incubator/setup-miniconda@v2 - with: - python-version: "3.10" - mamba-version: "*" - channels: conda-forge,defaults - channel-priority: true - activate-environment: anaconda-client-env - - name: Add conda to system path - run: | - echo $CONDA/bin >> $GITHUB_PATH - - name: Installing the library - shell: bash -l {0} - run: | - pip install -r requirements.txt - sudo wget https://github.com/jgm/pandoc/releases/download/1.16.0.2/pandoc-1.16.0.2-1-amd64.deb - sudo dpkg -i pandoc-1.16.0.2-1-amd64.deb - #sudo apt install pandoc - python3 -m pip install sphinx - pip install myst_parser - - name: Running the Sphinx to gh-pages Action - uses: uibcdf/action-sphinx-docs-to-gh-pages@v1.0-beta.2 - with: - branch: main - dir_docs: bootcamp - sphinxopts: "" + - uses: actions/checkout@v2 + + # Install dependencies + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install dependencies + run: | + pip install -r requirements.txt + pip install jupyter-book + + # Build the book + - name: Build the book + run: | + jupyter-book build . + + # Push the book's HTML to github-pages + - name: GitHub Pages action + uses: peaceiris/actions-gh-pages@v3.6.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./_build/html