Update generate-sitemap.yml #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate Dynamic Sitemap | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
generate-sitemap: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Install Dependencies | |
run: npm install sitemap-generator-cli | |
- name: Generate Sitemap | |
run: npx sitemap-generator-cli https://multiverse-dataverse.netlify.app/ -o Documentation/sitemap.md | |
- name: List Files | |
run: ls -la | |
- name: Configure Git | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
- name: Pull Latest Changes | |
run: git pull origin main --rebase | |
- name: Commit and Push Sitemap | |
run: | | |
git add sitemap.md | |
git commit -m "Update Sitemap [skip ci]" || echo "No changes to commit" | |
git push |