Build docs using github actions #1
Workflow file for this run
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: Build Documentation | |
on: | |
push: | |
branches: ["main", "improvement/github-actions-docc"] | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: macos-14 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: SwiftyLab/setup-swift@latest | |
with: | |
development: true | |
swift-version: latest | |
check-latest: true | |
- name: Build DocC | |
run: | | |
xcodebuild docbuild -scheme PlaydateKit \ | |
-derivedDataPath /tmp/docc \ | |
-destination 'platform=macOS' \ | |
-toolchain 'swift latest'; | |
$(xcrun -f docc -toolchain 'swift latest') process-archive \ | |
transform-for-static-hosting $(find /tmp/docc -type d -name '*.doccarchive') \ | |
--hosting-base-path PlaydateKit \ | |
--output-path docs; | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: 'docs' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |