From d5025403bd78a8a953bc3a67f31bdc9c45ab3a98 Mon Sep 17 00:00:00 2001 From: Iva Horn Date: Fri, 18 Jul 2025 13:34:21 +0200 Subject: [PATCH] feat(doc): Building and publishing a documentation catalog on GitHub pages. Signed-off-by: Iva Horn --- .github/workflows/documentation.yml | 70 +++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/documentation.yml diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 00000000..c95c0730 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,70 @@ +# SPDX-FileCopyrightText: Nextcloud GmbH +# SPDX-FileCopyrightText: 2025 Iva Horn +# SPDX-License-Identifier: GPL-3.0-or-later + +name: Documentation + +on: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-docs: + runs-on: macos-latest + steps: + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + - uses: actions/checkout@v4 + - name: Build documentation + run: | + xcodebuild docbuild \ + -scheme NextcloudKit \ + -destination 'platform=macOS' \ + -skipPackagePluginValidation \ + -derivedDataPath ./DerivedData + $(xcrun --find docc) process-archive \ + transform-for-static-hosting ./DerivedData/Build/Products/Debug/NextcloudKit.doccarchive \ + --output-path ./docs \ + --hosting-base-path /nextcloudkit + - name: Create root redirect + run: | + cat > ./docs/index.html << 'EOF' + + + + + NextcloudKit Documentation + + + + +

Redirecting to NextcloudKit Documentation...

+ + + + EOF + - name: Upload static files as artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./docs + deploy-docs: # See: https://github.com/actions/deploy-pages + needs: build-docs + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file