index-published #4185
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
env: | |
NODE_VERSION: '20.x' # set this to the node version to use | |
name: Regenerate the Sitemaps | |
on: | |
repository_dispatch: | |
types: | |
- index-published | |
workflow_dispatch: | |
jobs: | |
build-coveo: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- run: | | |
echo "Status: ${{ github.event.client_payload.status }}" | |
echo "Path: ${{ github.event.client_payload.path }}" | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Run scripts and commit changes | |
if: ${{ endsWith(github.event.client_payload.path, 'query-index.json') }} | |
working-directory: ./coveo | |
run: | | |
node generate-coveo-sitemap.js | |
- name: Commit and push changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "Update generated coveo.xml file." | |
repository: coveo | |
file_pattern: "coveo-xml.xml" | |
push_options: --force | |
build-sitemap: | |
needs: build-coveo | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- run: | | |
echo "Status: ${{ github.event.client_payload.status }}" | |
echo "Path: ${{ github.event.client_payload.path }}" | |
- name: Configure git | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Install dependencies | |
working-directory: ./tools/sitemap | |
run: npm install | |
- name: Run scripts and commit changes | |
working-directory: ./tools/sitemap | |
run: | | |
node create.js | |
- name: Commit and push changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "Update generated content-sitemap.xml file" | |
file_pattern: "content-sitemap.xml" | |
push_options: --force |