Netlify deploy with build flag uses different directory
See original GitHub issueDescribe the bug
netlify deploy
and netlify build
commands are working correctly
however, doing netlify deploy --build
uses a wrong deploy path.
netlify deploy:
Deploy path: /home/bronze/coding/gold/dist
Configuration path: /home/bronze/coding/gold/netlify.toml
netlify deploy --build
Deploy path: /home/bronze/coding/gold/astro build
Configuration path: /home/bronze/coding/gold/netlify.toml
Honestly i dont know ehere that astro build
is coming from
Steps to reproduce
Tried reverting to version 11.5.1
and everything worked.
Caught this discrepancy:
11.6.0
1. build.command from netlify.toml
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β$ astro build
11.5.1
1. build.command from netlify.toml
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β$ pnpm build || ( npm install pnpm && pnpm build )
I dont even have astro build
on my netlify.toml
. Changed the command on my package.json too and it didnt change, so im not sure where it is getting this command from.
Configuration
[build.environment]
NODE_VERSION = "16"
[build]
publish = "dist"
command = "pnpm build || ( npm install pnpm && pnpm build )"
[dev]
autoLaunch = false
command = "pnpm run dev"
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
Environment
System:
OS: Linux 5.10 Ubuntu 20.04.4 LTS (Focal Fossa)
CPU: (12) x64 AMD Ryzen 5 3600X 6-Core Processor
Memory: 21.98 GB / 25.02 GB
Container: Yes
Shell: 5.8 - /usr/bin/zsh
Binaries:
Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v16.13.0/bin/yarn
npm: 8.19.1 - ~/.nvm/versions/node/v16.13.0/bin/npm
npmGlobalPackages:
netlify-cli: 11.6.0
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Build configuration overview - Netlify Docs
Reference basic build settings for a repository using continuous deployment, and understand build image options for your site.
Read more >File-based configuration - Netlify Docs
The netlify.toml is a configuration file that specifies how Netlify builds and deploys your site β including redirects, branch and context-specific settings,Β ...
Read more >Manage build dependencies | Netlify Docs
Specify dependencies for your project so that our platform can install required languages and software before running a build.
Read more >Get started with Netlify CLI
You can use Netlify CLI to run a local development server that you can share with others, run a local build and plugins,...
Read more >Optional configuration for functions - Netlify Docs
Netlify will access the functions directory during every build, preparing and deploying each supported code file as a function. The default directory isΒ ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@bronze
Closing this as it has been resolved in https://github.com/netlify/cli/pull/5084.
Please update the Netlify CLI package to
v11.8.3
.Thank you @sarahetter for the super-quick fix.
@dariodevito Thank you for finding out the potential cause. I debugged @bronzeβs site independently & found the issue occurring at the mentioned line.
@sarahetter This issue seems to be originating in this PR: https://github.com/netlify/cli/pull/5029
The
publish
variable (which originally had the location of the build directory) is being overwritten by the build command.Could you please take a look?