Lift model functionality out of view and add unit tests #10
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 Documentation to Github Pages | |
on: | |
# Runs on pushes targeting the master branch | |
push: | |
branches: ["main"] | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
# One deployment deploy job since we're just deploying | |
deploy: | |
environment: | |
# Must set to this for deploying to GitHub Pages | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: macos-14 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Force Xcode 15.2 | |
run: sudo xcode-select -s "/Applications/Xcode_15.2.app" | |
- name: Build DocC | |
run: | | |
swift package resolve; | |
xcodebuild docbuild -scheme Autograph-Package -derivedDataPath /tmp/docbuild -destination 'platform=iOS Simulator,name=iPhone 15'; | |
echo "Archiving documentation..." | |
$(xcrun --find docc) process-archive \ | |
transform-for-static-hosting /tmp/docbuild/Build/Products/Debug-iphonesimulator/Autograph.doccarchive \ | |
--output-path docs \ | |
--hosting-base-path swift-ui-autograph; | |
echo "** Archived documentation**" | |
# swift package plugin --allow-writing-to-directory docs \ | |
# generate-documentation \ | |
# --disable-indexing \ | |
# --transform-for-static-hosting \ | |
# --hosting-base-path swift-ui-autograph \ | |
# --output-path docs | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
# Upload only docs directory | |
path: 'docs' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |