From 8187fea3351a4b839fdb842a62453a948015262e Mon Sep 17 00:00:00 2001 From: knaaptime Date: Wed, 30 Oct 2024 17:04:06 -0700 Subject: [PATCH] include serges edits to doc building workflow --- .github/workflows/build_docs.yml | 57 +++++++++++++++----------------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 1289a43..645c4c3 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -2,47 +2,41 @@ on: push: branches: - - master - main + jobs: docs: - name: CI (${{ matrix.os }}-${{ matrix.environment-file }}) + name: Build & Push Docs runs-on: ${{ matrix.os }} - continue-on-error: ${{ matrix.experimental }} - timeout-minutes: 20 + timeout-minutes: 90 strategy: matrix: os: ['ubuntu-latest'] - environment-file: [ci/311.yml] + environment-file: [ci/311.yaml] experimental: [false] defaults: run: shell: bash -l {0} + steps: - - uses: actions/checkout@v2 - - uses: actions/cache@v2 - env: - CACHE_NUMBER: 0 + - name: Checkout repo + uses: actions/checkout@v4 with: - path: ~/conda_pkgs_dir - key: ${{ matrix.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles(matrix.environment-file) }} - - uses: conda-incubator/setup-miniconda@v2 + fetch-depth: 0 # Fetch all history for all branches and tags. + + - name: Setup micromamba + uses: mamba-org/setup-micromamba@v1 with: - miniconda-version: 'latest' - channels: conda-forge - channel-priority: true - auto-update-conda: true - auto-activate-base: false - environment-file: ${{ matrix.environment-file }} - activate-environment: test - use-only-tar-bz2: true - - run: conda info --all - - run: conda list - - run: conda config --show-sources - - run: conda config --show - - run: pip install -e . --no-deps --force-reinstall - - run: cd docs; make html - - name: Commit documentation changes + environment-file: ${{ matrix.environment-file }} + micromamba-version: 'latest' + + - name: Install + run: pip install -e . --no-deps --force-reinstall + + - name: Make Docs + run: cd docs; make html + + - name: Commit Docs run: | git clone https://github.com/ammaraskar/sphinx-action-test.git --branch gh-pages --single-branch gh-pages cp -r docs/_build/html/* gh-pages/ @@ -51,12 +45,13 @@ git config --local user.name "GitHub Action" git add . git commit -m "Update documentation" -a || true - # The above command will fail if no changes were present, so we ignore - # the return code. - - name: Push changes + # The above command will fail if no changes were present, + # so we ignore the return code. + + - name: Push to gh-pages uses: ad-m/github-push-action@master with: branch: gh-pages directory: gh-pages github_token: ${{ secrets.GITHUB_TOKEN }} - force: true + force: true \ No newline at end of file