Skip to content

Generate xml sitemap #6

Generate xml sitemap

Generate xml sitemap #6

# Workflow syntax:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
name: Generate xml sitemap
# TODO: Define triggers
on:
# push:
# branches:
# - develop
# workflow_call:
workflow_dispatch:
jobs:
generate_sitemap:
runs-on: ubuntu-latest
name: Generate a sitemap
steps:
- name: Checkout the repo
# generate-sitemap relies on actions/checkout@v2 with fetch-depth: 0
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Generate the sitemap
id: sitemap
uses: cicirello/generate-sitemap@v1
with:
# TODO: Update to your github pages.
# This is the url to your website.
base-url-path: https://metablaster.github.io/WindowsFirewallRuleset/
# The path to the root of the website relative to the root of the repository.
path-to-root: docs
# Default true, to include html documents
include-html: true
# A list (separated by spaces) of file extensions which to include
additional-extensions: md
# Print sitemap stats in actions on github
- name: Sitemap 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 }}"
# Create pull request for generated sitemap
- name: Create Pull Request
id: pull_request
uses: peter-evans/create-pull-request@v4
with:
title: "Automated sitemap update"
body: >
Sitemap updated by the [generate-sitemap](https://github.com/cicirello/generate-sitemap)
GitHub action. Automated pull-request generated by the
[create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action.
# Print pull request stats in actions on github
- name: Pull request stats
if: ${{ steps.pull_request.outputs.pull-request-number }}
run: |
echo "Pull Request Number - ${{ steps.pull_request.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.pull_request.outputs.pull-request-url }}"