#109 workflow fix #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 - |