Skip to content

Commit 669552f

Browse files
committed
chore(ci): indexnow doc updates
- Added steps to prepare and upload IndexNow artifacts during the CI process. - Implemented a new script for managing IndexNow manifests and payloads. - Updated documentation to include instructions for setting up IndexNow integration. Signed-off-by: Cory Rylan <crylan@nvidia.com>
1 parent 12820b1 commit 669552f

3 files changed

Lines changed: 382 additions & 9 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 96 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
ci:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v6
17+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
1818
with:
1919
fetch-depth: 0
2020
lfs: true
@@ -34,7 +34,7 @@ jobs:
3434
run: node ./projects/internals/ci/ci-summary.js >> "$GITHUB_STEP_SUMMARY"
3535
- name: Upload build artifacts
3636
if: github.event_name == 'push'
37-
uses: actions/upload-artifact@v7
37+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
3838
with:
3939
name: build-artifacts
4040
retention-days: 1
@@ -62,17 +62,34 @@ jobs:
6262
projects/monaco/dist
6363
projects/monaco/package.json
6464
projects/pages/dist
65+
- name: Prepare IndexNow artifacts
66+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
67+
env:
68+
ELEMENTS_PAGES_BASE_URL: ${{vars.ELEMENTS_PAGES_BASE_URL}}
69+
INDEXNOW_KEY: ${{secrets.INDEXNOW_KEY}}
70+
run: >-
71+
node ./projects/internals/ci/indexnow.js prepare
72+
--site-dir projects/pages/dist
73+
--site-url "$ELEMENTS_PAGES_BASE_URL"
6574
- name: Upload pages artifact
6675
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
67-
uses: actions/upload-pages-artifact@v5
76+
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9
6877
with:
6978
path: projects/pages/dist
7079
include-hidden-files: true
80+
- name: Upload IndexNow state
81+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
82+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
83+
with:
84+
name: indexnow-state
85+
retention-days: 1
86+
path: projects/pages/dist/indexnow-manifest.json
87+
overwrite: true
7188

7289
lighthouse:
7390
runs-on: ubuntu-latest
7491
steps:
75-
- uses: actions/checkout@v6
92+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
7693
with:
7794
fetch-depth: 0
7895
lfs: true
@@ -94,7 +111,7 @@ jobs:
94111
contents: write
95112
id-token: write
96113
steps:
97-
- uses: actions/checkout@v6
114+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
98115
with:
99116
fetch-depth: 0
100117
lfs: true
@@ -107,7 +124,7 @@ jobs:
107124
with:
108125
install-playwright: 'false'
109126
- name: Download build artifacts
110-
uses: actions/download-artifact@v8
127+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
111128
with:
112129
name: build-artifacts
113130
path: projects
@@ -120,7 +137,7 @@ jobs:
120137
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
121138
run: WIREIT_PARALLEL=1 WIREIT_LOGGER=metrics pnpm run release
122139
- name: Upload MCP server manifest
123-
uses: actions/upload-artifact@v7
140+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
124141
with:
125142
name: mcp-server
126143
retention-days: 1
@@ -134,7 +151,7 @@ jobs:
134151
concurrency: mcp-registry-publish
135152
steps:
136153
- name: Download MCP server manifest
137-
uses: actions/download-artifact@v8
154+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
138155
with:
139156
name: mcp-server
140157
path: projects/cli
@@ -170,13 +187,83 @@ jobs:
170187
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
171188
runs-on: ubuntu-latest
172189
permissions:
190+
actions: read
191+
contents: read
173192
pages: write
174193
id-token: write
175194
environment:
176195
name: github-pages
177196
url: ${{steps.deployment.outputs.page_url}}
178197
concurrency: pages
179198
steps:
199+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
200+
with:
201+
sparse-checkout: |
202+
.nvmrc
203+
mise.toml
204+
projects/internals/ci/indexnow.js
205+
projects/internals/ci/package.json
206+
sparse-checkout-cone-mode: false
207+
- uses: jdx/mise-action@e6a8b3978addb5a52f2b4cd9d91eafa7f0ab959d
208+
with:
209+
version: 2026.6.14
210+
install: true
211+
cache: true
212+
- name: Download IndexNow state
213+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
214+
with:
215+
name: indexnow-state
216+
path: indexnow/current
217+
- name: Determine changed URLs
218+
env:
219+
ELEMENTS_PAGES_BASE_URL: ${{vars.ELEMENTS_PAGES_BASE_URL}}
220+
run: >-
221+
node ./projects/internals/ci/indexnow.js diff
222+
--current-file indexnow/current/indexnow-manifest.json
223+
--site-url "$ELEMENTS_PAGES_BASE_URL"
224+
--output-file indexnow/payload.json
225+
- name: Upload IndexNow payload
226+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
227+
with:
228+
name: indexnow-payload
229+
retention-days: 30
230+
path: indexnow/payload.json
231+
overwrite: true
180232
- name: Deploy to GitHub Pages
181233
id: deployment
182-
uses: actions/deploy-pages@v5
234+
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128
235+
236+
notify-indexnow:
237+
needs: deploy-pages
238+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
239+
runs-on: ubuntu-latest
240+
permissions:
241+
actions: read
242+
contents: read
243+
steps:
244+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
245+
with:
246+
sparse-checkout: |
247+
.nvmrc
248+
mise.toml
249+
projects/internals/ci/indexnow.js
250+
projects/internals/ci/package.json
251+
sparse-checkout-cone-mode: false
252+
- uses: jdx/mise-action@e6a8b3978addb5a52f2b4cd9d91eafa7f0ab959d
253+
with:
254+
version: 2026.6.14
255+
install: true
256+
cache: true
257+
- name: Download IndexNow payload
258+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
259+
with:
260+
name: indexnow-payload
261+
path: indexnow
262+
- name: Notify IndexNow
263+
env:
264+
ELEMENTS_PAGES_BASE_URL: ${{vars.ELEMENTS_PAGES_BASE_URL}}
265+
INDEXNOW_KEY: ${{secrets.INDEXNOW_KEY}}
266+
run: >-
267+
node ./projects/internals/ci/indexnow.js submit
268+
--payload-file indexnow/payload.json
269+
--site-url "$ELEMENTS_PAGES_BASE_URL"

‎projects/internals/BUILD.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ The following GitHub settings optimize code quality and stability within the rep
199199

200200
Scheduled workflows run nightly builds of the documentation as well as full runs of [Lighthouse CI](https://github.com/GoogleChrome/lighthouse-ci) against each of the 50+ components in the Elements library.
201201

202+
-[IndexNow](https://www.indexnow.org/)
203+
204+
The Pages deployment workflow notifies IndexNow after it publishes documentation updates. Before merging changes that enable this workflow, add an `INDEXNOW_KEY` repository Actions secret containing 8 to 128 letters, numbers, or dashes. The workflow publishes the verification file under the Pages project path, submits only changed sitemap URLs, and retains each notification payload for 30 days so maintainers can rerun a failed notification job.
205+
202206
## Release
203207

204208
[Semantic Release](https://github.com/semantic-release/semantic-release) is an open source tool for managing automatic publishing and deployment of libraries and packages following [SEMVER](https://semver.org/). This enables a fix or feature to be available within minutes of it merging and passing the CI automated tests. To integrate into GitHub, complete the following:

0 commit comments

Comments
 (0)