Код IT
← Каталог

Справочник по GitHub Actions — Генерация и публикация sitemap

Фрагмент из «Справочник по GitHub Actions»: Генерация и публикация sitemap.

yaml infra-securityencyclopedia8-04-devops-ci-cd-3113 embed URL статья в энциклопедии
YAML main.yaml
name: Weekly Sitemap Update

on:
  schedule:
    - cron: '0 3 * * 1'  # Понедельник, 3:00 UTC

jobs:
  update-sitemap:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@v4
      - run: npm install
      - run: npm run generate-sitemap
      - name: Commit sitemap
        run: |
          git config --global user.name 'github-actions[bot]'
          git config --global user.email 'github-actions[bot]@users.noreply.github.com'
          git add sitemap.xml
          git diff --staged --quiet || git commit -m "chore: update sitemap"
          git push
name: Weekly Sitemap Update

on:
  schedule:
    - cron: '0 3 * * 1'  # Понедельник, 3:00 UTC

jobs:
  update-sitemap:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@v4
      - run: npm install
      - run: npm run generate-sitemap
      - name: Commit sitemap
        run: |
          git config --global user.name 'github-actions[bot]'
          git config --global user.email 'github-actions[bot]@users.noreply.github.com'
          git add sitemap.xml
          git diff --staged --quiet || git commit -m "chore: update sitemap"
          git push