Add comprehensive DocC documentation guides #10
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: Documentation | |
| on: | |
| push: | |
| branches: [ master ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: macos-14 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Select Xcode 16.2 | |
| run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer | |
| - name: Build Documentation | |
| run: | | |
| xcodebuild docbuild \ | |
| -scheme SwiftDataTables \ | |
| -destination 'generic/platform=iOS Simulator' \ | |
| -derivedDataPath ./DerivedData \ | |
| OTHER_DOCC_FLAGS="--transform-for-static-hosting --hosting-base-path SwiftDataTables" | |
| - name: Prepare Documentation | |
| run: | | |
| mkdir -p docs | |
| cp -R ./DerivedData/Build/Products/Debug-iphonesimulator/SwiftDataTables.doccarchive/. ./docs | |
| # Create redirect from root to documentation | |
| cat > ./docs/index.html << 'EOF' | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>SwiftDataTables Documentation</title> | |
| <meta http-equiv="refresh" content="0; url=documentation/swiftdatatables/"> | |
| <link rel="canonical" href="documentation/swiftdatatables/"> | |
| </head> | |
| <body> | |
| <p>Redirecting to <a href="documentation/swiftdatatables/">SwiftDataTables Documentation</a>...</p> | |
| </body> | |
| </html> | |
| EOF | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./docs | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |