diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 80e6c79..238e163 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -3,8 +3,10 @@ # On a pull request the site is built and uploaded as an artifact only, so a broken catalog fails before the tag. # # No swift-docc-plugin: the kit adds no package dependency for its docs. `xcodebuild docbuild` builds the archives -# from the package's own schemes; `docc merge` (Xcode 16+) joins them. Needs Pages enabled with source "GitHub Actions" -# (repository Settings > Pages). Copied from CuboKit's pattern; the module list is read from the .docc catalogs. +# from the package's own schemes; `docc merge` (Xcode 16+) joins them. Pages source is "GitHub Actions" and the +# github-pages environment allows tags `*.*.*`. A release-please tag pushed with GITHUB_TOKEN (no org release app) +# starts no workflow, so release-please.yml then dispatches this workflow on the new tag. Copied from CuboKit's +# pattern; the module list is read from the .docc catalogs. name: Docs on: diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 1e1d546..471668d 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -8,7 +8,9 @@ # workflows. With the app token CI runs on the Release PR like on any PR, and the tag runs the tag workflows. # Without the app (variable unset) the job falls back to GITHUB_TOKEN and dispatches CI on the Release PR's branch. Step # env is evaluated even when `if` skips the step, so the PR JSON is read with jq rather than fromJSON (empty on a run with -# no Release PR). Needs "Allow GitHub Actions to create and approve pull requests". +# no Release PR). Without the app the tag starts no workflow either, so the job dispatches Docs on the new tag +# (`github.ref` is then `refs/tags/`, so its deploy job publishes to Pages). Needs "Allow GitHub Actions to +# create and approve pull requests". name: release-please on: @@ -63,3 +65,9 @@ jobs: env: PR: ${{ steps.release.outputs.pr }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Publish the docs for the new tag + if: steps.release.outputs.release_created && steps.app.outputs.token == '' + run: gh workflow run docs.yml --repo "$GITHUB_REPOSITORY" --ref "$TAG" + env: + TAG: ${{ steps.release.outputs.tag_name }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}