1- # .github/workflows/deploy-docc.yml
21name : Deploy DocC Documentation
32
43on :
98 workflow_dispatch :
109
1110permissions :
12- contents : write
11+ contents : read
1312 pages : write
1413 id-token : write
15- actions : read
1614
1715concurrency :
1816 group : " pages"
19- cancel-in-progress : false
17+ cancel-in-progress : true
2018
2119jobs :
22- build-and-deploy :
20+ deploy :
21+ environment :
22+ name : github-pages
23+ url : ${{ steps.deployment.outputs.page_url }}
2324 runs-on : macos-14
2425 steps :
2526 - name : Checkout
2627 uses : actions/checkout@v4
2728
29+ - name : Setup Pages
30+ uses : actions/configure-pages@v4
31+
2832 - name : Setup Xcode
2933 uses : maxim-lobanov/setup-xcode@v1
3034 with :
3135 xcode-version : latest-stable
3236
33- - name : Get repository name
34- id : repo-name
35- run : echo "REPO_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_OUTPUT
36-
37- - name : Build DocC Documentation
38- uses : ./.github/actions/build-docc
39- with :
40- products : ' ValidatorCore,ValidatorUI'
41- docc-paths : ' Sources/ValidatorCore/Validator.docc,Sources/ValidatorUI/ValidatorUI.docc'
42- bundle-identifier-prefix : ' dev.validator'
43- bundle-version : ' 1.0.0'
44- platforms : ' iOS,macOS,watchOS,tvOS,visionOS'
45- output-path : ' ./docs'
46- hosting-base-path : ' ${{ steps.repo-name.outputs.REPO_NAME }}'
47-
48- - name : Create Index Page
37+ - name : Build DocC
4938 run : |
39+ swift package resolve
40+
41+ # Build ValidatorCore documentation
42+ echo "Building ValidatorCore documentation..."
43+ xcodebuild docbuild \
44+ -scheme ValidatorCore \
45+ -derivedDataPath /tmp/docbuild \
46+ -destination 'generic/platform=iOS'
47+
48+ $(xcrun --find docc) process-archive \
49+ transform-for-static-hosting /tmp/docbuild/Build/Products/Debug-iphoneos/ValidatorCore.doccarchive \
50+ --output-path docs/ValidatorCore \
51+ --hosting-base-path 'validator/ValidatorCore'
52+
53+ # Build ValidatorUI documentation
54+ echo "Building ValidatorUI documentation..."
55+ xcodebuild docbuild \
56+ -scheme ValidatorUI \
57+ -derivedDataPath /tmp/docbuild \
58+ -destination 'generic/platform=iOS'
59+
60+ $(xcrun --find docc) process-archive \
61+ transform-for-static-hosting /tmp/docbuild/Build/Products/Debug-iphoneos/ValidatorUI.doccarchive \
62+ --output-path docs/ValidatorUI \
63+ --hosting-base-path 'validator/ValidatorUI'
64+
65+ # Create index page with module selection
5066 cat > docs/index.html << 'EOF'
5167 <!DOCTYPE html>
5268 <html lang="en">
@@ -186,14 +202,14 @@ jobs:
186202 </header>
187203
188204 <div class="docs-grid">
189- <a href="ValidatorCore/documentation/validatorcore/ " class="doc-card">
205+ <a href="ValidatorCore/documentation/validatorcore" class="doc-card">
190206 <span class="module-badge">Core Module</span>
191207 <h2>ValidatorCore</h2>
192208 <p>Core validation functionality and rules for Swift applications. Contains base types, protocols, and validator implementations.</p>
193209 <span class="link">View documentation</span>
194210 </a>
195211
196- <a href="ValidatorUI/documentation/validatorui/ " class="doc-card">
212+ <a href="ValidatorUI/documentation/validatorui" class="doc-card">
197213 <span class="module-badge">UI Module</span>
198214 <h2>ValidatorUI</h2>
199215 <p>UI components and helpers for building validation interfaces. Ready-to-use solutions for SwiftUI and UIKit.</p>
@@ -209,10 +225,11 @@ jobs:
209225 </html>
210226 EOF
211227
212- - name : Deploy to gh-pages
213- uses : peaceiris/ actions-gh- pages@v3
228+ - name : Upload artifact
229+ uses : actions/upload- pages-artifact @v3
214230 with :
215- github_token : ${{ secrets.GITHUB_TOKEN }}
216- publish_dir : ./docs
217- publish_branch : gh-pages
218- force_orphan : true
231+ path : ' docs'
232+
233+ - id : deployment
234+ name : Deploy to GitHub Pages
235+ uses : actions/deploy-pages@v4
0 commit comments