From 4a2a37f49f408e750513004cf5a95eb6646dfaaa Mon Sep 17 00:00:00 2001 From: Ross Motley Date: Fri, 14 Jun 2024 11:00:37 +0100 Subject: [PATCH 1/2] Publish docs --- .github/workflows/main.yaml | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 5c75db64..cce3e5c6 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -40,3 +40,48 @@ jobs: - name: Check source code licenses run: | docker run --platform=linux/amd64 -v ${PWD}:/src ghcr.io/google/addlicense -v -check -l BSD-2-Clause -c "ChipFlow" -s=only -ignore **/__init__.py **/*.py + + build-docs: + needs: test + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up PDM + uses: pdm-project/setup-pdm@v4 + with: + python-version: 3.9 + - name: Install deps + run: pdm install + - name: Build docs + run: pdm run document + - name: Upload docs artifact + uses: actions/upload-artifact@v4 + with: + name: docs + path: docs/_build + + publish-docs: + needs: build-docs + if: ${{ github.repository == 'chipflow/chipflow-lib' }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Download docs artifact + uses: actions/download-artifact@v4 + with: + name: docs + path: docs/ + - name: Publish "latest" docs + if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }} + uses: JamesIves/github-pages-deploy-action@releases/v4 + with: + repository-name: chipflow/chipflow.github.io + ssh-key: ${{ secrets.PAGES_DEPLOY_KEY }} + branch: main + folder: docs/ + target-folder: chipflow-lib/en/latest/ + \ No newline at end of file From 6b1a7bbd7ac9c3679498d08ffebf77f6a7c24a2f Mon Sep 17 00:00:00 2001 From: Ross Motley Date: Fri, 14 Jun 2024 11:25:50 +0100 Subject: [PATCH 2/2] Remove superfluous /en/ from url --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index cce3e5c6..3932ee8e 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -83,5 +83,5 @@ jobs: ssh-key: ${{ secrets.PAGES_DEPLOY_KEY }} branch: main folder: docs/ - target-folder: chipflow-lib/en/latest/ + target-folder: chipflow-lib/latest/ \ No newline at end of file