File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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."
Original file line number Diff line number Diff line change 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" ,
You can’t perform that action at this time.
0 commit comments