Files
swift-inotify/.github/workflows/docs.yml
T
T. R. Bernstein f01e16e864
Docs / docs (push) Canceled after 0s
Docs / deploy (push) Canceled after 0s
Pin the docs workflow to Swift 6.3
Without a version the setup action installs the latest toolchain.
Swift 6.4.0 shipped on 2026-09-15 and the swiftly build cached on the
runner cannot install it, so the docs job started failing.
2026-09-16 21:01:26 +02:00

63 lines
1.9 KiB
YAML

name: Docs
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Pages
uses: actions/configure-pages@v5
- name: Set up Swift
uses: swift-actions/setup-swift@v3
with:
swift-version: "6.3"
skip-verify-signature: true
- name: Generate Docs
run: |
swift package add-dependency --from 1.4.0 "https://github.com/apple/swift-docc-plugin.git"
for target in Inotify InotifyTaskCLI; do
lower="${target,,}"
mkdir -p "./public/$lower"
swift package --allow-writing-to-directory "./public/$lower" \
generate-documentation --disable-indexing --transform-for-static-hosting \
--target "$target" \
--hosting-base-path "swift-inotify/$lower" \
--output-path "./public/$lower"
done
- name: Copy Index Page
run: |
cp ./.github/workflows/index.tpl.html public/index.html
sed -i -e 's/{{project.name}}/Swift Inotify/g' public/index.html
sed -i -e 's/{{project.tagline}}/🗂️ Monitor filesystem events on Linux using modern Swift concurrency/g' public/index.html
sed -i -e 's|{{project.links}}|<li><a href="inotify/documentation/inotify/">Inotify</a>: The actual library.</li><li><a href="inotifytaskcli/documentation/inotifytaskcli/">TaskCLI</a>: The project build command.</li>|g' public/index.html
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: ./public
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: docs
steps:
- name: Deploy Docs
uses: actions/deploy-pages@v4