name: Generate Docs
on:
  push:
    branches: [master]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          ssh-key: ${{ secrets.DEPLOY_KEY }}
      - name: Use Node.js 22.4.1
        uses: actions/setup-node@v4
        with:
          node-version: '22.4.1'
      - run: yarn install
      - name: Run build:docs
        run: yarn build:docs
      - name: Commit files
        run: |
          echo ${{ github.ref }}
          git add .
          git config --local user.email "${{ github.actor }}@users.noreply.github.com"
          git config --local user.name "${{ github.actor }}"
          git commit -m "ci: Updated docs [skip ci]" -a --no-verify | exit 0
      - name: Push Changes
        uses: ad-m/github-push-action@master
        env:
          HUSKY_SKIP_HOOKS: true
