From 9013798729a83d6f176c69187a8041d9a51d0d5d Mon Sep 17 00:00:00 2001 From: eschmidt42 <11818904+eschmidt42@users.noreply.github.com> Date: Sat, 13 Sep 2025 08:36:05 +0200 Subject: [PATCH 1/3] fix: using github actions to upload and deploy --- .github/workflows/documentation.yml | 36 ++++++++++++++++++----------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 9b9994a..e9fcbf7 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,18 +1,23 @@ +# Deploy MkDocs site via Upload/Deploy Pages actions (recommended) +permissions: + contents: write + pages: write + id-token: write + name: documentation on: push: branches: - - main + - main pull_request: branches: - - main + - main jobs: build: runs-on: ubuntu-24.04 timeout-minutes: 10 - strategy: matrix: python-version: @@ -32,18 +37,21 @@ jobs: - name: Set up Python ${{ matrix.python-version }} run: uv python install ${{ matrix.python-version }} - - name: Create virtal environment - run: |- - make install-docs-env + - name: Create virtual environment + run: make install-docs-env - name: Download data - run: |- - uv run bundestag download huggingface --y + run: uv run bundestag download huggingface --y - - name: Build documentation - run: |- - make docs + - name: Build documentation (mkdocs) + # Ensure this produces the static site in the 'site' directory + run: | + uv run mkdocs build -d site + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: site - - name: Deploy documentation - run: |- - uv run mkdocs gh-deploy --force + - name: Deploy to GitHub Pages + uses: actions/deploy-pages@v4 From e426bc2f478c1c85d8a1ce542fd1880a3eebe56c Mon Sep 17 00:00:00 2001 From: eschmidt42 <11818904+eschmidt42@users.noreply.github.com> Date: Sat, 13 Sep 2025 08:44:41 +0200 Subject: [PATCH 2/3] chore: add build environment --- .github/workflows/documentation.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index e9fcbf7..6a7eb70 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,4 +1,3 @@ -# Deploy MkDocs site via Upload/Deploy Pages actions (recommended) permissions: contents: write pages: write @@ -17,6 +16,8 @@ on: jobs: build: runs-on: ubuntu-24.04 + environment: + name: github-pages timeout-minutes: 10 strategy: matrix: From d09e89be6e8a2ca847cf7675bd34fc2d78b4da38 Mon Sep 17 00:00:00 2001 From: eschmidt42 <11818904+eschmidt42@users.noreply.github.com> Date: Sat, 13 Sep 2025 09:07:22 +0200 Subject: [PATCH 3/3] fix: deployment via gh-pages branch after push to main --- .github/workflows/documentation.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 6a7eb70..8e82240 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -9,9 +9,6 @@ on: push: branches: - main - pull_request: - branches: - - main jobs: build: @@ -49,10 +46,11 @@ jobs: run: | uv run mkdocs build -d site - - name: Upload Pages artifact - uses: actions/upload-pages-artifact@v3 + - name: Deploy to gh-pages branch + uses: peaceiris/actions-gh-pages@v4 with: - path: site - - - name: Deploy to GitHub Pages - uses: actions/deploy-pages@v4 + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./site + publish_branch: gh-pages + # optional: set a deploy commit message + commit_message: "docs: deploy site from CI"