Skip to content

Update update-sitemap.yml #2

Update update-sitemap.yml

Update update-sitemap.yml #2

Workflow file for this run

name: Update Sitemap
on:
push:
branches:
- master # Change this to your default branch if needed
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Update XML Sitemap
run: |
echo '<?xml version="1.0" encoding="UTF-8"?>' > sitemap.xml
echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' >> sitemap.xml
echo ' <url>' >> sitemap.xml
echo ' <loc>https://adilparwez.live</loc>' >> sitemap.xml
echo ' <lastmod>'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'</lastmod>' >> sitemap.xml
echo ' <changefreq>monthly</changefreq>' >> sitemap.xml
echo ' <priority>0.5</priority>' >> sitemap.xml
echo ' </url>' >> sitemap.xml
echo '</urlset>' >> sitemap.xml
git config user.name 'GitHub Actions'
git config user.email '[email protected]'
git add sitemap.xml
git commit -m "Update sitemap.xml"
git push
env:
GH_TOKEN: ${{ secrets.TOKEN }}