Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish DocC to GitHub Pages | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Verify macOS and Xcode version | |
| run: | | |
| sw_vers | |
| xcodebuild -version | |
| - name: Build DocC | |
| run: | | |
| set -euo pipefail | |
| derived_data_path="$(mktemp -d)" | |
| output_path="docs" | |
| schemes=("ClerkKit" "ClerkKitUI") | |
| archives=() | |
| for scheme in "${schemes[@]}"; do | |
| xcodebuild docbuild \ | |
| -scheme "$scheme" \ | |
| -destination "generic/platform=iOS" \ | |
| -derivedDataPath "$derived_data_path" | |
| archive_path="$(find "$derived_data_path" -type d -name "${scheme}.doccarchive" -print -quit)" | |
| if [ -z "$archive_path" ]; then | |
| echo "❌ DocC archive not found for $scheme in $derived_data_path" | |
| exit 1 | |
| fi | |
| archives+=("$archive_path") | |
| done | |
| merged_archive_path="$derived_data_path/ClerkCombined.doccarchive" | |
| xcrun docc merge "${archives[@]}" \ | |
| --synthesized-landing-page-name "Clerk iOS" \ | |
| --synthesized-landing-page-kind "Package" \ | |
| --output-path "$merged_archive_path" | |
| xcrun docc process-archive transform-for-static-hosting \ | |
| "$merged_archive_path" \ | |
| --output-path "$output_path" \ | |
| --hosting-base-path "${{ github.event.repository.name }}" | |
| if [ ! -d "$output_path/documentation/clerkkit" ]; then | |
| echo "❌ Missing /documentation/clerkkit in generated docs output" | |
| exit 1 | |
| fi | |
| if [ ! -d "$output_path/documentation/clerkkitui" ]; then | |
| echo "❌ Missing /documentation/clerkkitui in generated docs output" | |
| exit 1 | |
| fi | |
| echo '<script>window.location.href += "/documentation/clerkkit"</script>' > "$output_path/index.html" | |
| mkdir -p "$output_path/documentation/clerk" | |
| echo '<script>window.location.href = "/clerk-ios/documentation/clerkkit"</script>' > "$output_path/documentation/clerk/index.html" | |
| - name: Upload GitHub Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |