name: Publish examples (presets)
on:
  schedule:
    - cron: "0 16 1/2 * *"
  workflow_dispatch:
  workflow_call:
jobs:
  examples:
    runs-on: ubuntu-latest
    if: "github.repository == 'lowlighter/metrics'"
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Setup NodeJS
        uses: actions/setup-node@v2
        with:
          node-version: 17
      - name: Setup metrics
        run: npm ci
      - name: Publish presets examples
        run: npm run presets -- publish
        env:
          GITHUB_TOKEN: ${{ github.token }}


