Netlify building my site after manual deploy w/ Stopped Builds

I’m deploying my site using netlify-cli. We build using vite in the github runner then deploy. But after it deploys it builds the site again even though we have Stopped Builds selected. What’s wrong with my github workflow or netlify settings that’s causing Netlify to run vite build a second time after the site is already deployed?

name: Deploy App to Production

on:
  workflow_dispatch:

jobs:
  deploy:
    name: Deploy to Netlify
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - name: Install Node.js
        uses: actions/setup-node@v3
        with:
          node-version: '20'

      - name: Install dependencies
        run: |
          rm -rf api
          rm -rf crystal
          rm -rf netsuite
          rm tsconfig.json
          mv tsconfig-app-prod.json tsconfig.json
          npm ci
          npm run codegen:app

      - name: Build project
        run: cd app && npm run build # Removed 'app:' prefix since we're in the app directory
        env:
          ....

      - name: Install Netlify CLI
        run: npm install -g netlify-cli

      - name: Create netlify.toml
        run: |
          echo '[build]
          publish = "build"
          base = "app"' > netlify.toml

      - name: Deploy to Netlify
        run: cd app && netlify deploy --prod --dir=app/build
        env:
          NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
          NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}

this is the output in my github actions post deploy

Run cd app && netlify deploy --prod --dir=app/build

Netlify Build                                                 
────────────────────────────────────────────────────────────────
​
❯ Version
  @netlify/build 33.4.3
​
❯ Flags
  accountId: 66f3585f0afc027c61ed9382
  packagePath: app

​
❯ Current directory
  /home/runner/work/trm/trm/app
​
❯ Config file
  /home/runner/work/trm/trm/netlify.toml
​
❯ Context
  production
​
Build command from Netlify app                                
────────────────────────────────────────────────────────────────
​
$ npm --workspace @trm/app run build

> @trm/app@3.0.0 build
> tsc -b && vite build

site name
dashboard.topstep.com

I think this has something to do with Github’s webhook. Basically every single time I push or merge to my main branch this triggers a webhook build regardless of the netlify-cli usage.

Best approach to fixing this is probably

  1. Go your dashboard
  2. Site settings > Build and deploy
  3. Settings
  4. Disconnect Git Provider

Do note that you can still proceed with building via cli or github action, but this will prevent netlify from auto building.

This was a change in CLI v21: Release v21.0.0 · netlify/cli. The deploy command now runs a build as a part of itself. If you wish to run a build before the deploy command, you need to use netlify deploy --no-build.