From b68529e6825614b6f337f12449922eac0a8b2698 Mon Sep 17 00:00:00 2001 From: jarvis-at-skic Date: Tue, 11 Aug 2026 19:48:39 +0000 Subject: [PATCH] ci: publish documentation to Gitea Pages --- .gitea/workflows/build.yml | 54 ++++++++++++-------------------------- docusaurus.config.ts | 4 +-- 2 files changed, 19 insertions(+), 39 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index b6c5fa5..8daf86e 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -23,46 +23,26 @@ jobs: with: version: 9 - - name: Get pnpm store directory - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - - name: Cache pnpm dependencies - uses: actions/cache@v4 - with: - path: ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- - - name: Install dependencies run: pnpm install --frozen-lockfile - name: Build run: pnpm build - - name: Upload build artifact - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - uses: actions/upload-artifact@v4 - with: - name: docusaurus-build - path: build/ - retention-days: 7 - - # Uncomment when deployment target is configured - # deploy: - # needs: build - # runs-on: ubuntu-latest - # if: github.event_name == 'push' && github.ref == 'refs/heads/main' - # steps: - # - name: Download build artifact - # uses: actions/download-artifact@v4 - # with: - # name: docusaurus-build - # path: build/ - # - # - name: Deploy to server - # run: | - # # Add deployment steps here (rsync, docker, etc.) - # echo "Deploying documentation..." + - name: Publish to Pages + if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/main' + shell: bash + run: | + set -euo pipefail + ORG_REPO='${{ gitea.repository }}' + case "$ORG_REPO" in + */*) ;; + *) echo "invalid repository slug: $ORG_REPO" >&2; exit 1 ;; + esac + case "$ORG_REPO" in + *..*|/*|*/|*//* ) echo "unsafe repository slug: $ORG_REPO" >&2; exit 1 ;; + esac + test -f build/index.html + destination="/gondor-v1-gitea-pages/$ORG_REPO" + mkdir -p "$destination" + rsync -a --delete build/ "$destination/" diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 5622bcb..0441de0 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -7,8 +7,8 @@ const config: Config = { tagline: 'Autonomous application documentation', favicon: 'img/favicon.ico', - url: 'https://docs.skic-playground.lego-cloud.eu', - baseUrl: '/', + url: 'https://pages.apps.lego-cloud.eu', + baseUrl: '/skic-v1-playground/documentation/', organizationName: 'skic-v1-playground', projectName: 'documentation',