.github/workflows/sitemap.yml
name: Generate Sitemap
on:
push:
branches:
- main # Replace with your default branch if not 'main'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.17' # Specify Go version
- name: Generate Sitemap
run: go run generate_sitemap/generate_sitemap.go
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./ # Replace with the directory where your site is generated