Skip to content

Optimize IndexNow submission for efficiency and reliability #28

Optimize IndexNow submission for efficiency and reliability

Optimize IndexNow submission for efficiency and reliability #28

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Ruby Setup
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Build site
run: bundle exec middleman build
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'build'
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Ping IndexNow
run: |
http_code=$(curl -s -o /tmp/indexnow-response.txt -w "%{http_code}" \
-H "Content-Type: application/json; charset=utf-8" \
-d '{
"host":"csa-admin.org",
"key":"8f940d3ccbab4035acab547df3432ac0",
"keyLocation":"https://csa-admin.org/8f940d3ccbab4035acab547df3432ac0.txt",
"urlList":[
"https://csa-admin.org/",
"https://csa-admin.org/acp/",
"https://csa-admin.org/solawi/"
]
}' \
"https://api.indexnow.org/indexnow")
echo "IndexNow canonical URL submission → HTTP ${http_code}"
cat /tmp/indexnow-response.txt
if [ "${http_code}" -lt 200 ] || [ "${http_code}" -ge 300 ]; then
exit 1
fi