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