Skip to content

Commit 3145bbe

Browse files
spyraeclaude
andcommitted
feat: add deploy script with IndexNow + Yandex ping automation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3d89c5f commit 3145bbe

2 files changed

Lines changed: 41 additions & 1 deletion

File tree

landing/deploy.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
SITE="proxycraft.tech"
5+
PROJECT="proxycraft-landing"
6+
INDEXNOW_KEY="509ba55d653644589424addd0fd8322a"
7+
SITEMAP_URL="https://${SITE}/sitemap-index.xml"
8+
9+
echo "🔨 Building ${SITE}..."
10+
rm -rf dist
11+
npm run build
12+
13+
echo "🚀 Deploying to Cloudflare Pages..."
14+
npx wrangler pages deploy dist --project-name="${PROJECT}" --branch=main --commit-dirty=true
15+
16+
echo "📡 Notifying IndexNow (Bing + Yandex)..."
17+
URLS=$(curl -s "${SITEMAP_URL}" | grep -o '<loc>[^<]*</loc>' | sed 's/<\/*loc>//g')
18+
SITEMAP_URLS=""
19+
for sitemap in $URLS; do
20+
PAGE_URLS=$(curl -s "$sitemap" | grep -o '<loc>[^<]*</loc>' | sed 's/<\/*loc>//g')
21+
SITEMAP_URLS="${SITEMAP_URLS}${PAGE_URLS}"$'\n'
22+
done
23+
24+
URL_JSON=$(echo "$SITEMAP_URLS" | grep -v '^$' | head -100 | jq -R . | jq -s .)
25+
26+
curl -s -X POST "https://api.indexnow.org/indexnow" \
27+
-H "Content-Type: application/json" \
28+
-d "{
29+
\"host\": \"${SITE}\",
30+
\"key\": \"${INDEXNOW_KEY}\",
31+
\"keyLocation\": \"https://${SITE}/${INDEXNOW_KEY}.txt\",
32+
\"urlList\": ${URL_JSON}
33+
}" -w "\nIndexNow: HTTP %{http_code}\n"
34+
35+
echo "📡 Pinging Yandex..."
36+
curl -s -o /dev/null -w "Yandex Sitemap Ping: HTTP %{http_code}\n" \
37+
"https://webmaster.yandex.ru/ping?sitemap=${SITEMAP_URL}"
38+
39+
echo "✅ Done! ${SITE} deployed and search engines notified."

landing/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"dev": "astro dev",
88
"build": "astro build",
99
"preview": "astro preview",
10-
"astro": "astro"
10+
"astro": "astro",
11+
"deploy": "./deploy.sh"
1112
},
1213
"dependencies": {
1314
"@astrojs/react": "^4.4.2",

0 commit comments

Comments
 (0)