-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (79 loc) · 3.36 KB
/
Copy pathindexnow.yml
File metadata and controls
84 lines (79 loc) · 3.36 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: IndexNow — Notify Search Engines
on:
push:
branches: [main]
# Re-submit weekly to keep freshness signals strong
schedule:
- cron: '0 6 * * 1' # Every Monday at 06:00 UTC
workflow_dispatch:
env:
SITE_URL: https://thoangdev.github.io
INDEXNOW_KEY: 8f3a7d2c9b4e1056
jobs:
ping-indexnow:
runs-on: ubuntu-latest
steps:
# ── Bulk submission via IndexNow JSON API ─────────────────────
# Distributes to Google, Bing, Yandex, Seznam, Naver, and more
- name: Submit URL list to IndexNow (api.indexnow.org)
run: |
PAYLOAD=$(cat <<'JSON'
{
"host": "thoangdev.github.io",
"key": "8f3a7d2c9b4e1056",
"keyLocation": "https://thoangdev.github.io/8f3a7d2c9b4e1056.txt",
"urlList": [
"https://thoangdev.github.io/",
"https://thoangdev.github.io/#about",
"https://thoangdev.github.io/#experience",
"https://thoangdev.github.io/#skills",
"https://thoangdev.github.io/#projects",
"https://thoangdev.github.io/#books",
"https://thoangdev.github.io/#awards",
"https://thoangdev.github.io/#contact-form",
"https://thoangdev.github.io/assets/resume-pdf.html"
]
}
JSON
)
STATUS=$(curl -s -o /tmp/indexnow_response.txt -w "%{http_code}" \
-X POST "https://api.indexnow.org/indexnow" \
-H "Content-Type: application/json; charset=utf-8" \
-d "$PAYLOAD")
echo "IndexNow (api.indexnow.org) status: $STATUS"
cat /tmp/indexnow_response.txt || true
if [ "$STATUS" -ne 200 ] && [ "$STATUS" -ne 202 ]; then
echo "::warning::IndexNow api.indexnow.org returned $STATUS"
fi
# ── Bing direct submission ────────────────────────────────────
- name: Submit URL list to Bing IndexNow directly
run: |
PAYLOAD=$(cat <<'JSON'
{
"host": "thoangdev.github.io",
"key": "8f3a7d2c9b4e1056",
"keyLocation": "https://thoangdev.github.io/8f3a7d2c9b4e1056.txt",
"urlList": [
"https://thoangdev.github.io/",
"https://thoangdev.github.io/#about",
"https://thoangdev.github.io/#experience",
"https://thoangdev.github.io/#skills",
"https://thoangdev.github.io/#projects",
"https://thoangdev.github.io/#awards",
"https://thoangdev.github.io/#contact-form"
]
}
JSON
)
STATUS=$(curl -s -o /tmp/bing_response.txt -w "%{http_code}" \
-X POST "https://www.bing.com/indexnow" \
-H "Content-Type: application/json; charset=utf-8" \
-d "$PAYLOAD")
echo "Bing IndexNow status: $STATUS"
cat /tmp/bing_response.txt || true
if [ "$STATUS" -ne 200 ] && [ "$STATUS" -ne 202 ]; then
echo "::warning::Bing IndexNow returned $STATUS"
fi
# ── Google IndexNow (via api.indexnow.org already covers Google)
# Explicit Google submission via Search Console API requires OAuth;
# api.indexnow.org relay handles Google automatically since 2023.