Skip to content

#109 Support for dev docs; canonical URLs #1

#109 Support for dev docs; canonical URLs

#109 Support for dev docs; canonical URLs #1

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 }}
VERSION: ${{ github.ref_name }}
run: |
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
VERSION_LABEL="${VERSION#v}"
else
VERSION_LABEL="dev"
fi
gh api repos/hardwood-hq/hardwood-hq.github.io/dispatches \
--field event_type=publish-docs \
--field client_payload="$(cat <<EOF
{
"source_ref": "${{ github.sha }}",
"version": "$VERSION_LABEL",
"update_latest": true
}
EOF
)"