From adb91f7915ef49480d0840ca0feaf7d143425d25 Mon Sep 17 00:00:00 2001 From: eecavanna Date: Tue, 19 Nov 2024 17:13:22 -0800 Subject: [PATCH] Update home page to link to non-legacy documentation --- .../compile-current-nmdc-documentation.yml | 44 +++++++++++++++++++ .github/workflows/deploy-to-gh-pages.yml | 5 +++ content/index.html | 9 +++- 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/compile-current-nmdc-documentation.yml diff --git a/.github/workflows/compile-current-nmdc-documentation.yml b/.github/workflows/compile-current-nmdc-documentation.yml new file mode 100644 index 0000000..f225d91 --- /dev/null +++ b/.github/workflows/compile-current-nmdc-documentation.yml @@ -0,0 +1,44 @@ +# This GitHub Actions workflow compiles the Sphinx documentation into web-based documentation. +# Reference: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions +name: Compile current NMDC documentation into HTML + +on: + push: { branches: [ main ] } + workflow_dispatch: { } + # Allow this workflow to be called by other workflows. + # Reference: https://docs.github.com/en/actions/using-workflows/reusing-workflows + workflow_call: { } + +jobs: + compile: + name: Compile + runs-on: ubuntu-latest + defaults: + run: + # Set a default working directory for all `run` steps in this job. + # Reference: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_iddefaultsrun + working-directory: content/nmdc + permissions: + contents: read + steps: + - name: Check out commit # Docs: https://github.com/actions/checkout + uses: actions/checkout@v4 + - name: Set up Python # Docs: https://github.com/actions/setup-python + uses: actions/setup-python@v5 + with: { python-version: '3.12' } + - name: Install Sphinx # Docs: https://pypi.org/project/Sphinx/ + run: pip install Sphinx + - name: Install other dependencies + run: pip install -r requirements.txt + - name: Compile source documents into HTML + run: sphinx-build -b html src ${{ github.workspace }}/content/nmdc/_build/html + # Upload the result as an "artifact" so it can then be downloaded and used by another job. + - name: Save the HTML for publishing later # Docs: https://github.com/actions/upload-artifact + uses: actions/upload-artifact@v4 + with: + name: current-nmdc-documentation-as-html + # Note: Relative `path` values here are relative to the _workspace_, not to the current working directory. + # Reference: https://github.com/actions/upload-artifact/pull/477#issue-2044900649 + path: content/nmdc/_build/html + if-no-files-found: error + retention-days: 1 # Note: 1 day is the shortest period possible diff --git a/.github/workflows/deploy-to-gh-pages.yml b/.github/workflows/deploy-to-gh-pages.yml index 8a957f5..596c009 100644 --- a/.github/workflows/deploy-to-gh-pages.yml +++ b/.github/workflows/deploy-to-gh-pages.yml @@ -17,6 +17,9 @@ jobs: compile-legacy-nmdc-documentation: name: Compile legacy NMDC documentation uses: ./.github/workflows/compile-legacy-nmdc-documentation.yml + compile-current-nmdc-documentation: + name: Compile current NMDC documentation + uses: ./.github/workflows/compile-current-nmdc-documentation.yml fetch-and-compile-nmdc-runtime-documentation: name: Fetch and compile NMDC Runtime documentation uses: ./.github/workflows/fetch-and-compile-nmdc-runtime-documentation.yml @@ -30,6 +33,7 @@ jobs: # Reference: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idneeds needs: - compile-legacy-nmdc-documentation + - compile-current-nmdc-documentation - fetch-and-compile-nmdc-runtime-documentation - fetch-and-compile-mag-workflow-documentation runs-on: ubuntu-latest @@ -47,6 +51,7 @@ jobs: ls -R artifacts mkdir -p _build/html _build/html/legacy _build/html/workflows cp -R artifacts/legacy-nmdc-documentation-as-html _build/html/legacy/nmdc-documentation + cp -R artifacts/current-nmdc-documentation-as-html _build/html/nmdc cp -R artifacts/nmdc-runtime-documentation-as-html _build/html/nmdc-runtime-documentation cp -R artifacts/mag-workflow-documentation-as-html _build/html/workflows/mag-workflow-documentation cp -R content/assets _build/html/assets diff --git a/content/index.html b/content/index.html index db55e2f..0de89dd 100644 --- a/content/index.html +++ b/content/index.html @@ -98,12 +98,17 @@

Running bioinformatics workflows

Other stuff

- Explore documentation produced during earlier phases of the project. + Read tutorials, how-to guides, references, and explanations of various aspects of the NMDC.