From 18d75906f002e6806f17ebdc9b91f911cb48e7ca Mon Sep 17 00:00:00 2001 From: Miles Curry <2590700+MiCurry@users.noreply.github.com> Date: Mon, 5 Oct 2026 16:26:21 -0600 Subject: [PATCH] Update sphinx build GitHub workflow to deploy develop branch This commit updates the build-sphinx-docs.yml GitHub workflow so that the the develop branch's documentation will be built and deployed to our GitHub Pages site: https://magnetotellurics.github.io/ModEM/develop/. To do this, we simply use the `destination_dir` in the actions-gh-pages action to place the develop branch inside. Doing this allows us to navigate to the develop version of the docs under the above URL. We might want to consider doing this for future releases or release branches? --- .github/workflows/build-sphinx-docs.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-sphinx-docs.yml b/.github/workflows/build-sphinx-docs.yml index 376eaa03..aa02b28c 100644 --- a/.github/workflows/build-sphinx-docs.yml +++ b/.github/workflows/build-sphinx-docs.yml @@ -1,6 +1,10 @@ -name: "Build Sphinx Docs: Build and update" +name: "Build and Deploy Sphinx Docs" -on: push +on: + push: + branches: + - main + - develop jobs: build: @@ -18,9 +22,21 @@ jobs: with: name: html-docs path: docs/build/html/ + # In order to deploy develop to our GitHub pages site, we can + # have actions-gh-pages deploy to destination_dir and then access + # the develop branch as a subdirectory of the website: i.e.: + # https://magnetotellurics.github.io/ModEM/develop/ + - name: Determine Destination Directory + run: | + if [ "${{ github.ref_name }}" = "main" ]; then + echo "DEPLOY_DEST=" >> $GITHUB_ENV + else + echo "DEPLOY_DEST=${{ github.ref_name }}" >> $GITHUB_ENV + fi - name: Deploy uses: peaceiris/actions-gh-pages@v3 - if: github.ref == 'refs/heads/main' with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: docs/build/html \ No newline at end of file + publish_dir: docs/build/html + destination_dir: ${{ env.DEPLOY_DEST }} + keep_files: true