Skip to content

Instantly share code, notes, and snippets.

@sbooth
Created May 8, 2024 15:35
Show Gist options
  • Save sbooth/2572774ef00cbaffa61380dda14f7f18 to your computer and use it in GitHub Desktop.
Save sbooth/2572774ef00cbaffa61380dda14f7f18 to your computer and use it in GitHub Desktop.
DocC GitHub workflow
name: DocC
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Build Documentation
run: >
swift package
--allow-writing-to-directory .docs
generate-documentation
--target CAAudioHardware
--disable-indexing
--hosting-base-path CAAudioHardware
--output-path .docs
- name: Setup GitHub Pages
id: pages
uses: actions/configure-pages@v5
- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v3
with:
path: .docs
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment