1+ # SPDX-FileCopyrightText: Nextcloud GmbH
2+ # SPDX-FileCopyrightText: 2025 Iva Horn
3+ # SPDX-License-Identifier: GPL-3.0-or-later
4+
5+ name : Documentation
6+
7+ on :
8+ push :
9+ branches :
10+ - main
11+
12+ concurrency :
13+ group : ${{ github.workflow }}-${{ github.ref }}
14+ cancel-in-progress : true
15+
16+ jobs :
17+ build-docs :
18+ runs-on : macos-latest
19+ steps :
20+ - uses : maxim-lobanov/setup-xcode@v1
21+ with :
22+ xcode-version : latest-stable
23+ - uses : actions/checkout@v4
24+ - name : Build documentation
25+ run : |
26+ xcodebuild docbuild \
27+ -scheme NextcloudKit \
28+ -destination 'platform=macOS' \
29+ -skipPackagePluginValidation \
30+ -derivedDataPath ./DerivedData
31+ $(xcrun --find docc) process-archive \
32+ transform-for-static-hosting ./DerivedData/Build/Products/Debug/NextcloudKit.doccarchive \
33+ --output-path ./docs \
34+ --hosting-base-path /nextcloudkit
35+ - name : Create root redirect
36+ run : |
37+ cat > ./docs/index.html << 'EOF'
38+ <!DOCTYPE html>
39+ <html>
40+ <head>
41+ <meta charset="utf-8">
42+ <title>NextcloudKit Documentation</title>
43+ <meta http-equiv="refresh" content="0; url=./documentation/nextcloudkit/">
44+ <link rel="canonical" href="./documentation/nextcloudkit/">
45+ </head>
46+ <body>
47+ <p>Redirecting to <a href="./documentation/nextcloudkit/">NextcloudKit Documentation</a>...</p>
48+ <script>
49+ window.location.href = "./documentation/nextcloudkit/";
50+ </script>
51+ </body>
52+ </html>
53+ EOF
54+ - name : Upload static files as artifact
55+ uses : actions/upload-pages-artifact@v3
56+ with :
57+ path : ./docs
58+ deploy-docs : # See: https://github.com/actions/deploy-pages
59+ needs : build-docs
60+ permissions :
61+ pages : write
62+ id-token : write
63+ environment :
64+ name : github-pages
65+ url : ${{ steps.deployment.outputs.page_url }}
66+ runs-on : ubuntu-latest
67+ steps :
68+ - name : Deploy to GitHub Pages
69+ id : deployment
70+ uses : actions/deploy-pages@v4
0 commit comments