Skip to content

User Guide to Workflow Automation 👨‍🔧#

If you already use GitHub Actions to automate workflows in your website projects, you can also use it to automate the process of submitting your sitemap to the IndexNow API.

This is particularly useful if you have a large number of pages on your site that you want to submit all at once so search engines know when to crawl your site for faster indexing by Bing, Yandex, DuckDuckGo and other search engines.

How to Automatically Submit a Sitemap to IndexNow#

Regardless of whether your codebase is highly or less active, it is recommended that you do not submit your sitemap to IndexNow each time your site is deployed to production. This could overwhelm IndexNow and reduce the website's ranking.

Instead, you should automate sitemap submissions to IndexNow using GitHub Actions at regular intervals, allowing the changes to accumulate over time and allowing the search engines crawlers time to index the latest content.

Example workflow with GitHub Actions:

.github/workflows/submit_sitemap_to_index_now.yml
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
name: Submit Sitemap to IndexNow

on:
  schedule:
    - cron: 0 0 1 * *  # Run at midnight UTC on the 1st day of each month.

jobs:
  submit-sitemap:
    runs-on: ubuntu-latest
    steps:
      - name: Submit sitemap URLs to IndexNow
        uses: jakob-bagterp/index-now-submit-sitemap-urls-action@v1
        with:
          host: example.com
          api_key: ${{ secrets.INDEX_NOW_API_KEY }}
          api_key_location: https://example.com/${{ secrets.INDEX_NOW_API_KEY }}.txt
          endpoint: yandex
          sitemap_locations: https://example.com/sitemap.xml

Want to know more about the parameters? Learn how to customise your workflow parameters.

Checklist

Before running the workflow, make sure you have done the following:

  • Added the API key INDEX_NOW_API_KEY as a secret to your repository.
  • Uploaded the API key to the location specified in the api_key_location parameter.
  • Updated the URL of the sitemap in the sitemap_location parameter.
  • Adjusted the host, endpoint, and other parameters to suit your needs.