name: release

# Doc: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions

on:
  push:
    branches:
      - master
    paths:
      - 'dashboards/**/*.json'
  # Allow this workflow to be manually triggered
  workflow_dispatch:

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      # Doc: https://github.com/marketplace/actions/checkout
      - name: Checkout ${{ github.repository }}
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      # Doc: https://github.com/marketplace/actions/setup-node-js-environment
      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 20

      # Doc: https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/ci-configurations/github-actions.md
      - name: Semantic Release
        env:
          GITHUB_TOKEN: ${{ secrets.PAT }}
        run: npx semantic-release
