diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 000000000..25c95228b --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,63 @@ +name: Build and Deploy Documentation + +on: + push: + branches: [main, develop] + pull_request: + branches: [main, develop] + workflow_dispatch: # Allow manual trigger + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v5 + with: + submodules: recursive + + - name: Setup Python 3.11 + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements_docs.txt + # Install pace packages for autodoc + pip install -e . || true + + - name: Build documentation + run: | + cd docs + make html + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs/_build/html + + deploy: + # Only deploy on push to main/develop, not on PRs + if: github.event_name == 'push' + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/docs/conf.py b/docs/conf.py index 224bfa352..7989fef63 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -25,8 +25,8 @@ # -- Project information ----------------------------------------------------- project = "Pace" -copyright = "2022, AI2 Climate Modeling Team" -author = "AI2 Climate Modeling Team" +copyright = "2022-2025, NOAA-GFDL (originally developed by AI2 Climate Modeling Team)" +author = "NOAA-GFDL" # -- General configuration ---------------------------------------------------