From 8dfd631232179352542f956680ab92caffeb9663 Mon Sep 17 00:00:00 2001 From: yemeen Date: Wed, 16 Apr 2025 16:06:50 -0400 Subject: [PATCH 1/2] Update workflow to deploy docs to GitHub Pages --- .github/workflows/docs.yml | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 2b2b3be..30015bf 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,8 +14,8 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 - + fetch-depth: 0 + - name: Install uv uses: astral-sh/setup-uv@v5 @@ -23,6 +23,7 @@ jobs: uses: actions/setup-python@v4 with: python-version-file: "pyproject.toml" + - name: Install system dependencies run: | sudo apt-get update @@ -40,17 +41,9 @@ jobs: source .venv/bin/activate make html - - name: Configure Git - run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' - - - name: Commit and push if changed - run: | - if [[ -n "$(git status --porcelain docs/)" ]]; then - git add docs/ - git commit -m "docs: auto-generate documentation" - git push origin HEAD:main - else - echo "No changes to commit" - fi \ No newline at end of file + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs + force_orphan: true \ No newline at end of file From 3487f17a14e4cda648c8614d7e62fa8cf774d15f Mon Sep 17 00:00:00 2001 From: yemeen Date: Wed, 16 Apr 2025 16:08:10 -0400 Subject: [PATCH 2/2] Add pull request trigger for doc_source and src/ect paths so breaking doc changes cant be pushed --- .github/workflows/docs.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 30015bf..1294c3b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -5,6 +5,11 @@ on: paths: - 'doc_source/**' - 'src/ect/**' + pull_request: + branches: [ "main" ] + paths: + - 'doc_source/**' + - 'src/ect/**' jobs: docs: @@ -42,6 +47,7 @@ jobs: make html - name: Deploy to GitHub Pages + if: github.event_name == 'push' uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }}