Skip to content

Add comprehensive DocC documentation guides #10

Add comprehensive DocC documentation guides

Add comprehensive DocC documentation guides #10

Workflow file for this run

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