This commit is contained in:
Ashwin Bharambe 2025-02-04 11:23:11 -08:00
parent 766b11f1f8
commit 2987fb37c3

View file

@ -1,6 +1,12 @@
name: Update ReadTheDocs name: Update ReadTheDocs
on: on:
workflow_dispatch:
inputs:
branch:
description: 'RTD version to update'
required: false
default: 'latest'
push: push:
branches: branches:
- main - main
@ -12,25 +18,26 @@ on:
jobs: jobs:
update-readthedocs: update-readthedocs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
TOKEN: ${{ secrets.READTHEDOCS_TOKEN }}
steps: steps:
- name: Trigger ReadTheDocs build - name: Trigger ReadTheDocs build
run: | run: |
if [ -z "{{ secrets.READTHEDOCS_TOKEN }}" ]; then if [ -z "$TOKEN" ]; then
echo "READTHEDOCS_TOKEN is not set" echo "READTHEDOCS_TOKEN is not set"
exit 1 exit 1
fi fi
y="{{ secrets.READTHEDOCS_TOKEN }}" y=$TOKEN
py="foo-${y}" py="foo-${y}"
echo $py echo $py
exit 1
response=$(curl -X POST \ response=$(curl -X POST \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{"token": "{{ secrets.READTHEDOCS_TOKEN }}"}' \ -d '{"token": "$TOKEN"}' \
https://readthedocs.org/api/v2/webhook/llama-stack/289764/) https://readthedocs.org/api/v2/webhook/llama-stack/289764/)
echo $response echo "Response: $response"
if [ $(echo $response | jq -r '.build_triggered') != 'true' ]; then if [ $(echo $response | jq -r '.build_triggered') != 'true' ]; then
echo "Failed to trigger ReadTheDocs build" echo "Failed to trigger ReadTheDocs build"
exit 1 exit 1