Update docc.yml #5
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 | |
pwd | |
ls -la | |
# Build documentation for DigiMeSDK | |
echo "Building documentation for DigiMeSDK..." | |
swift package \ | |
--allow-writing-to-directory ./temp_docs/sdk \ | |
--package-path DigiMeSDK \ | |
generate-documentation \ | |
--target DigiMeSDK \ | |
--output-path ./temp_docs/sdk \ | |
--transform-for-static-hosting \ | |
--hosting-base-path digime-sdk-ios/sdk | |
# Build documentation for DigiMeCore | |
echo "Building documentation for DigiMeCore..." | |
swift package \ | |
--allow-writing-to-directory ./temp_docs/core \ | |
--package-path DigiMeCore \ | |
generate-documentation \ | |
--target DigiMeCore \ | |
--output-path ./temp_docs/core \ | |
--transform-for-static-hosting \ | |
--hosting-base-path digime-sdk-ios/core | |
# Build documentation for DigiMeHealthKit | |
echo "Building documentation for DigiMeHealthKit..." | |
swift package \ | |
--allow-writing-to-directory ./temp_docs/healthkit \ | |
--package-path DigiMeHealthKit \ | |
generate-documentation \ | |
--target DigiMeHealthKit \ | |
--output-path ./temp_docs/healthkit \ | |
--transform-for-static-hosting \ | |
--hosting-base-path digime-sdk-ios/healthkit | |
# 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="sdk/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="core/documentation/digimecore/">View Documentation</a></p> | |
</div> | |
<div class="library"> | |
<h2>DigiMe HealthKit</h2> | |
<p>HealthKit integration for DigiMe SDK.</p> | |
<p><a href="healthkit/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 |