Skip to content

Update build-deploy-DocC.yml #16

Update build-deploy-DocC.yml

Update build-deploy-DocC.yml #16

name: Deploy DocC Documentation to Github Pages
on:
# Runs on version tag pushes
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
# 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