From c5e6509b7d037db6846fc454c235f897b62eddf2 Mon Sep 17 00:00:00 2001 From: Nate O'Farrell Date: Tue, 3 Mar 2026 15:41:55 -0500 Subject: [PATCH 1/6] first pass --- .github/workflows/docs.yml | 66 ++++++++++++++++++++++++++++++++++++++ pyproject.toml | 2 +- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..2afc231 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,66 @@ +# Copyright 2026 Commonwealth Fusion Systems (CFS), all rights reserved. +# This entire source code file represents the sole intellectual property of CFS. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# To publish: enable GitHub Pages in the repo (Settings > Pages > Source: GitHub Actions). +name: Publish docs to GitHub Pages + +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + build-docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Install uv + uses: astral-sh/setup-uv@v6 + + - name: Install nxlib and dev dependencies + run: uv sync --dev + + - name: Build documentation + run: uv run python scripts/generate_docs.py doc_build + + - name: Add .nojekyll + run: touch doc_build/.nojekyll + + - name: Upload GitHub Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: doc_build + + deploy: + needs: build-docs + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/pyproject.toml b/pyproject.toml index 0c18ff2..9fc02a4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,7 @@ dependencies = [ [project.urls] Homepage = "https://github.com/cfs-energy/nxlib" -# TODO (SW-14420): Add URL for documentation +Documentation = "https://cfs-energy.github.io/nxlib/" Repository = "https://github.com/cfs-energy/nxlib" Issues = "https://github.com/cfs-energy/nxlib/issues" Changelog = "https://github.com/cfs-energy/nxlib/blob/main/CHANGELOG.md" From 43a77b78939b8ffd33a5c74a70ce26e4c67ea824 Mon Sep 17 00:00:00 2001 From: Nate O'Farrell Date: Tue, 3 Mar 2026 15:42:13 -0500 Subject: [PATCH 2/6] add pr for initial trigger --- .github/workflows/docs.yml | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 2afc231..259b5bf 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,19 +1,3 @@ -# Copyright 2026 Commonwealth Fusion Systems (CFS), all rights reserved. -# This entire source code file represents the sole intellectual property of CFS. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# To publish: enable GitHub Pages in the repo (Settings > Pages > Source: GitHub Actions). name: Publish docs to GitHub Pages on: @@ -21,6 +5,7 @@ on: branches: - main workflow_dispatch: + pull_request: permissions: contents: read From e940335a05e3c4cf612e1c7c4af4d0c260ba66c2 Mon Sep 17 00:00:00 2001 From: Nate O'Farrell Date: Tue, 3 Mar 2026 15:48:23 -0500 Subject: [PATCH 3/6] only deploy on main --- .github/workflows/docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 259b5bf..2162d21 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -41,6 +41,7 @@ jobs: deploy: needs: build-docs + if: github.ref == 'refs/heads/main' && github.event_name == 'push' runs-on: ubuntu-latest environment: name: github-pages From c8e1af35d8b250062d9b1c43fd73d58b3d0cae26 Mon Sep 17 00:00:00 2001 From: Nate O'Farrell Date: Tue, 3 Mar 2026 15:49:29 -0500 Subject: [PATCH 4/6] naming --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 2162d21..cc87f74 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,4 +1,4 @@ -name: Publish docs to GitHub Pages +name: Build & Publish Docs on: push: From 1a1e5535d4af26bf57522523b0291de9915c75dc Mon Sep 17 00:00:00 2001 From: Nate O'Farrell Date: Tue, 3 Mar 2026 15:51:53 -0500 Subject: [PATCH 5/6] clean --- .github/workflows/docs.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index cc87f74..82ddc8f 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -31,9 +31,6 @@ jobs: - name: Build documentation run: uv run python scripts/generate_docs.py doc_build - - name: Add .nojekyll - run: touch doc_build/.nojekyll - - name: Upload GitHub Pages artifact uses: actions/upload-pages-artifact@v3 with: From a79a42fbe3a403dacf7c1ddc6779c990d93ac86e Mon Sep 17 00:00:00 2001 From: Blair Frandeen Date: Wed, 4 Mar 2026 08:35:15 -0500 Subject: [PATCH 6/6] Remove PR trigger --- .github/workflows/docs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 82ddc8f..7085f83 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -5,7 +5,6 @@ on: branches: - main workflow_dispatch: - pull_request: permissions: contents: read