【GitHub】GitHub Actions で自動的にGoogleにsitemap.xmlを送信する
GitHub Actions で自動的にGoogleにsitemap.xmlを送信する
SEO対策のために sitemap.xml を GitHub Actions を利用して自動的に送信するように致しました。
sitemap.xml を送信する
name: update-sitemap
on:
schedule:
- cron: '0 0,12 * * *'
jobs:
update-sitemap:
runs-on: ubuntu-latest
steps:
- name: Update Google Ping Sitemap
run: |
curl -X GET "https://www.google.com/ping?sitemap=https://example.com/sitemap.xml"
curl -X GET "https://www.google.com/ping?sitemap=https://example2.com/sitemap.xml"
curl -X GET "https://www.google.com/ping?sitemap=https://example3.com/sitemap.xml"
※cron の時間は UTC なので 日本時間で考えると -9 時間されますので注意してください。