diff --git a/.github/workflows/docs-notify.yml b/.github/workflows/docs-notify.yml new file mode 100644 index 00000000..a39fce7b --- /dev/null +++ b/.github/workflows/docs-notify.yml @@ -0,0 +1,35 @@ +name: Notify the docs site + +# A change to the app manual on dev tells offband-site to rebuild and publish +# docs.offband.org/app/ (#1148, offband-site#77). GitHub cannot trigger a +# workflow in another repository, so this side sends a repository dispatch. The +# site validates the payload and builds the current dev head itself; the SHA is +# a notification, not a checkout. +on: + push: + branches: [dev] + paths: ['docs/user/**'] +# No workflow_dispatch: it would run a branch's own copy of this file with the +# PAT. To republish by hand, run offband-site's Documentation workflow instead. + +permissions: + contents: read + +jobs: + notify: + if: github.ref == 'refs/heads/dev' + runs-on: ubuntu-latest + steps: + # The payload is offband-site's version-1 contract (its scripts/build_docs.py + # validate_event): exactly these four fields, or the site refuses the run. + - name: Send the app-docs dispatch to offband-site + env: + GH_TOKEN: ${{ secrets.PROJECT_PAT }} + SOURCE_SHA: ${{ github.sha }} + run: >- + gh api repos/OffbandMesh/offband-site/dispatches --method POST + -f event_type=app-docs + -F 'client_payload[schema_version]=1' + -f 'client_payload[source_repository]=OffbandMesh/meshcore-client' + -f 'client_payload[source_ref]=refs/heads/dev' + -f "client_payload[source_sha]=$SOURCE_SHA"