Skip to content

Commit

Permalink
Update sitemap-generator.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
pufanyi authored Jun 20, 2023
1 parent bab87b0 commit a231952
Showing 1 changed file with 30 additions and 23 deletions.
53 changes: 30 additions & 23 deletions .github/workflows/sitemap-generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,43 @@ name: Generate xml sitemap

on:
push:
branches: [ main ]
branches:
- main

jobs:
sitemap_job:
runs-on: ubuntu-latest
name: Generate a sitemap

steps:
- name: Checkout the repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Checkout the repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Generate the sitemap
id: sitemap
uses: cicirello/[email protected]
with:
base-url-path: https://pufanyi.github.io/FYPMS
- name: Generate the sitemap
id: sitemap
uses: cicirello/[email protected]
with:
base-url-path: https://pufanyi.github.io/FYPMS

- name: Output stats
run: |
echo "sitemap-path = ${{ steps.sitemap.outputs.sitemap-path }}"
echo "url-count = ${{ steps.sitemap.outputs.url-count }}"
echo "excluded-count = ${{ steps.sitemap.outputs.excluded-count }}"
- name: Modify repository
run: |
git config user.name "Pu Fanyi"
git config user.email "[email protected]"
git add .
git commit -m "Update Sitemap.xml"
git push
- name: Output stats
run: |
echo "sitemap-path = ${{ steps.sitemap.outputs.sitemap-path }}"
echo "url-count = ${{ steps.sitemap.outputs.url-count }}"
echo "excluded-count = ${{ steps.sitemap.outputs.excluded-count }}"
- name: Modify repository
run: |
git config user.name "Pu Fanyi"
git config user.email "[email protected]"
git add .
git commit -m "Update Sitemap.xml"
git push
- name: Deploy to GitHub Pages
if: ${{ contains(github.event.head_commit.message, 'Update Sitemap.xml') }}
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public

0 comments on commit a231952

Please sign in to comment.