Update docc.yml to build dependencies first and then the library #4
This file contains 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: Deploy DocC | |
on: | |
push: | |
branches: [ master ] | |
workflow_dispatch: | |
jobs: | |
generate-documentation: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Xcode | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: latest-stable | |
- name: Build Documentation | |
run: | | |
mkdir -p ./temp_docs | |
for scheme in DigiMeSDK DigiMeCore DigiMeHealthKit; do | |
echo "Building documentation for $scheme..." | |
# Navigate to package directory | |
cd $scheme | |
# Build documentation | |
swift package --allow-writing-to-directory ../temp_docs/$scheme \ | |
generate-documentation --target $scheme \ | |
--output-path ../temp_docs/$scheme \ | |
--transform-for-static-hosting \ | |
--hosting-base-path digime-sdk-ios/$scheme | |
cd .. | |
done | |
# Create main index.html | |
cat > ./temp_docs/index.html << 'EOL' | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>DigiMe iOS SDK Documentation</title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
body { | |
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; | |
max-width: 800px; | |
margin: 0 auto; | |
padding: 20px; | |
} | |
h1 { color: #333; } | |
.library { | |
margin: 20px 0; | |
padding: 20px; | |
border: 1px solid #ddd; | |
border-radius: 8px; | |
} | |
a { color: #0366d6; text-decoration: none; } | |
a:hover { text-decoration: underline; } | |
</style> | |
</head> | |
<body> | |
<h1>DigiMe iOS SDK Documentation</h1> | |
<div class="library"> | |
<h2>DigiMe SDK</h2> | |
<p>The main SDK for integrating with DigiMe services.</p> | |
<p><a href="DigiMeSDK/documentation/digimesdk/">View Documentation</a></p> | |
</div> | |
<div class="library"> | |
<h2>DigiMe Core</h2> | |
<p>Core functionality and models used across DigiMe libraries.</p> | |
<p><a href="DigiMeCore/documentation/digimecore/">View Documentation</a></p> | |
</div> | |
<div class="library"> | |
<h2>DigiMe HealthKit</h2> | |
<p>HealthKit integration for DigiMe SDK.</p> | |
<p><a href="DigiMeHealthKit/documentation/digimehealthkit/">View Documentation</a></p> | |
</div> | |
</body> | |
</html> | |
EOL | |
# Create .nojekyll file | |
touch ./temp_docs/.nojekyll | |
- name: Deploy to GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: temp_docs | |
branch: gh-pages | |
clean: true |