Skip to content

#109 workflow fix

#109 workflow fix #3

Workflow file for this run

name: Trigger documentation publish
on:
push:
branches: [main]
paths: ['docs/**']
tags: ['v*']
jobs:
dispatch:
runs-on: ubuntu-latest
steps:
- name: Fire repository_dispatch to site repo
env:
GH_TOKEN: ${{ secrets.DOCS_DISPATCH_TOKEN }}
run: |
REF="${{ github.ref_name }}"
SHA="${{ github.sha }}"
if [[ "$REF" == v* ]]; then
VERSION_LABEL="${REF#v}"
else
VERSION_LABEL="dev"
fi
jq -n \
--arg ref "$SHA" \
--arg ver "$VERSION_LABEL" \
'{event_type: "publish-docs", client_payload: {source_ref: $ref, version: $ver, update_latest: true}}' \
| gh api repos/hardwood-hq/hardwood-hq.github.io/dispatches --input -