-
Notifications
You must be signed in to change notification settings - Fork 1
29 lines (27 loc) · 817 Bytes
/
docs.yml
File metadata and controls
29 lines (27 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
name: Trigger Read the Docs Build
on:
push:
branches: [main]
paths:
- "docs/**"
- ".readthedocs.yaml"
- "pyproject.toml"
release:
types: [published]
workflow_dispatch:
jobs:
trigger-rtd:
runs-on: ubuntu-latest
steps:
- name: Trigger Read the Docs webhook
env:
WEBHOOK_URL: ${{ secrets.READTHEDOCS_WEBHOOK_URL }}
WEBHOOK_TOKEN: ${{ secrets.READTHEDOCS_WEBHOOK_TOKEN }}
run: |
PAYLOAD='{"ref": "refs/heads/main"}'
SIGNATURE=$(echo -n "${PAYLOAD}" | openssl dgst -sha256 -hmac "${WEBHOOK_TOKEN}" | awk '{print $2}')
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Hub-Signature-256: sha256=${SIGNATURE}" \
-d "${PAYLOAD}" \
"${WEBHOOK_URL}"