Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/index-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,40 @@ jobs:
KV_REST_API_URL: ${{ secrets.KV_REST_API_URL }}
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_ADMIN_API_KEY: ${{ secrets.ALGOLIA_ADMIN_API_KEY }}

- name: Revalidate changelog index cache
run: |
echo "Revalidating changelog index cache..."

# Create JSON payload
PAYLOAD='{"pathIndices": ["changelog"]}'

# Call revalidation API
HTTP_CODE=$(curl -X POST "${{ secrets.DOCS_SITE_URL }}/api/revalidate/indices" \
-H "Authorization: Bearer ${{ secrets.DOCS_SITE_API_KEY }}" \
-H "Content-Type: application/json" \
-d "$PAYLOAD" \
--max-time 30 \
--fail-with-body \
-o response.json \
-w "%{http_code}" \
-s)

echo ""
echo "Response (HTTP $HTTP_CODE):"
jq '.' response.json || cat response.json

# Check HTTP status
if [ "$HTTP_CODE" != "200" ]; then
echo "::error::Indices revalidation API returned status $HTTP_CODE"
exit 1
fi

# Check success field in response
SUCCESS=$(jq -r '.success' response.json)
if [ "$SUCCESS" != "true" ]; then
echo "::warning::Revalidation completed with errors"
jq -r '.errors[]?' response.json
else
echo "::notice::✅ Successfully revalidated changelog index"
fi
45 changes: 45 additions & 0 deletions .github/workflows/index-main-content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,48 @@ jobs:
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_ADMIN_API_KEY: ${{ secrets.ALGOLIA_ADMIN_API_KEY }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}

- name: Revalidate docs index and nav caches
run: |
echo "Revalidating docs index and navigation caches..."

# Extract tab IDs from docs.yml (these are the nav tree keys)
NAV_TREES=$(yq -o=json '.tabs | keys' fern/docs.yml)
echo "Nav trees to revalidate: $NAV_TREES"

# Create JSON payload using jq
PAYLOAD=$(jq -n \
--argjson navTrees "$NAV_TREES" \
'{pathIndices: ["docs"], navTrees: $navTrees}')

echo "Payload: $PAYLOAD"

# Call revalidation API
HTTP_CODE=$(curl -X POST "${{ secrets.DOCS_SITE_URL }}/api/revalidate/indices" \
-H "Authorization: Bearer ${{ secrets.DOCS_SITE_API_KEY }}" \
-H "Content-Type: application/json" \
-d "$PAYLOAD" \
--max-time 30 \
--fail-with-body \
-o response.json \
-w "%{http_code}" \
-s)

echo ""
echo "Response (HTTP $HTTP_CODE):"
jq '.' response.json || cat response.json

# Check HTTP status
if [ "$HTTP_CODE" != "200" ]; then
echo "::error::Indices revalidation API returned status $HTTP_CODE"
exit 1
fi

# Check success field in response
SUCCESS=$(jq -r '.success' response.json)
if [ "$SUCCESS" != "true" ]; then
echo "::warning::Revalidation completed with errors"
jq -r '.errors[]?' response.json
else
echo "::notice::✅ Successfully revalidated docs index and nav trees"
fi
39 changes: 39 additions & 0 deletions .github/workflows/index-sdk-references.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,42 @@ jobs:
KV_REST_API_URL: ${{ secrets.KV_REST_API_URL }}
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_ADMIN_API_KEY: ${{ secrets.ALGOLIA_ADMIN_API_KEY }}

- name: Revalidate SDK index and wallets nav cache
run: |
echo "Revalidating SDK index and wallets nav cache..."

# SDK indexer only updates the wallets nav tree (hardcoded in indexer)
PAYLOAD='{"pathIndices": ["sdk"], "navTrees": ["wallets"]}'

echo "Payload: $PAYLOAD"

# Call revalidation API
HTTP_CODE=$(curl -X POST "${{ secrets.DOCS_SITE_URL }}/api/revalidate/indices" \
-H "Authorization: Bearer ${{ secrets.DOCS_SITE_API_KEY }}" \
-H "Content-Type: application/json" \
-d "$PAYLOAD" \
--max-time 30 \
--fail-with-body \
-o response.json \
-w "%{http_code}" \
-s)

echo ""
echo "Response (HTTP $HTTP_CODE):"
jq '.' response.json || cat response.json

# Check HTTP status
if [ "$HTTP_CODE" != "200" ]; then
echo "::error::Indices revalidation API returned status $HTTP_CODE"
exit 1
fi

# Check success field in response
SUCCESS=$(jq -r '.success' response.json)
if [ "$SUCCESS" != "true" ]; then
echo "::warning::Revalidation completed with errors"
jq -r '.errors[]?' response.json
else
echo "::notice::✅ Successfully revalidated SDK index and wallets nav"
fi
Loading