Skip to content

Commit 0fa1b47

Browse files
committed
chore: add docs deploy workflow
1 parent fe24429 commit 0fa1b47

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ name: Deploy Docs
33
on:
44
push:
55
branches: [main]
6-
paths: ["docs/**"]
6+
paths:
7+
- "docs/**"
8+
- ".github/workflows/deploy-docs.yml"
79
workflow_dispatch:
810

911
permissions:
@@ -26,7 +28,7 @@ jobs:
2628
fetch-depth: 0
2729
- uses: actions/setup-node@v4
2830
with:
29-
node-version: lts/*
31+
node-version: 24.14.0
3032
- name: Install dependencies
3133
working-directory: docs
3234
run: npm ci
@@ -47,3 +49,23 @@ jobs:
4749
steps:
4850
- id: deployment
4951
uses: actions/deploy-pages@v4
52+
- name: Refresh root sitemap
53+
env:
54+
GH_TOKEN: ${{ secrets.PAGES_REFRESH_TOKEN }}
55+
PAGE_URL: ${{ steps.deployment.outputs.page_url }}
56+
SOURCE_REPOSITORY: ${{ github.repository }}
57+
SOURCE_RUN_ID: ${{ github.run_id }}
58+
SOURCE_SHA: ${{ github.sha }}
59+
run: |
60+
if [ -z "$GH_TOKEN" ]; then
61+
echo "PAGES_REFRESH_TOKEN is not configured; skipping root sitemap refresh."
62+
exit 0
63+
fi
64+
65+
curl -fsSL \
66+
-X POST \
67+
-H "Accept: application/vnd.github+json" \
68+
-H "Authorization: Bearer $GH_TOKEN" \
69+
-H "X-GitHub-Api-Version: 2022-11-28" \
70+
https://api.github.com/repos/sergeyshmakov/sergeyshmakov.github.io/dispatches \
71+
-d "{\"event_type\":\"project-docs-deployed\",\"client_payload\":{\"repository\":\"$SOURCE_REPOSITORY\",\"page_url\":\"$PAGE_URL\",\"run_id\":\"$SOURCE_RUN_ID\",\"sha\":\"$SOURCE_SHA\"}}"

0 commit comments

Comments
 (0)