Github workflownot working, while the netlify deploy does

I have used netlify dev to successfully build and run a react app that calls a netlify function and gets a result. I fee very proud of myself.

However, still not able to figure you what netlify deploy is suppose to do. Here’s the output I get:

➜ pgnfen2 git:(fbadmin2) netlify deploy git:(fbadmin2|)
Deploy path: /home/jlowery2663/projects/pgnfen2/build
Functions path: /home/jlowery2663/projects/pgnfen2/functions
Configuration path: /home/jlowery2663/projects/pgnfen2/netlify.toml
Deploying to draft URL…
:heavy_check_mark: Finished hashing 18 files and 1 functions
:heavy_check_mark: CDN requesting 0 files and 1 functions
:heavy_check_mark: Finished uploading 1 assets
:heavy_check_mark: Draft deploy is live!

Logs: Netlify App
Live Draft URL: https://5db391f0aac93cd3a2a50c7a--nervous-swirles-c221b3.netlify.com

If everything looks good on your draft URL, take it live with the --prod flag.
netlify deploy --prod


I go to the Live Draft URL, and I see the same old page that I checked into master on github. What gives?

Hi Jeff,

It’s intended to deploy what you have built locally. I can see however from this log line:

CDN requesting 0 files and 1 functions

…that there are no changes versus content we’ve seen before. Are you sure there are local changes within your deploy directory (note that there is no “building” step beyond what you’ve already done right before running netlify deploy, so maybe you just haven’t rebuilt since you made changes?)

Hi, Chris:

As I explained, I can build and deploy locally with netlify dev, but neither netlify dev --prod nor netlify deploy appears to be working. The log line you see is probably me repeating the process, hoping for a magically different outcome :face_with_hand_over_mouth:

What I can do is make a small code change, deploy it locally, verify that the React page shows the correct markup, verify that the test button invokes the lambda, and show the lambda response of ‘okay’. Then show that the firestore database was actually updated by the lambda.

Then I can do a production deploy, and show that the outcome is different that what happens locally.

However, it is time for me to make dinner and I’ll have to get back with you. I really hope it is me that’s screwing up, but I’m starting to doubt my abilities in that department.

Okay, you pointed me in the right direction, Chris. I had executed a netlify functions:build but overlooked the react build. I was/am confused by the difference between netlify dev, netlify deploy, and the github auto-build.

Once I ran yarn build, then netlify deploy, everything worked okay. However, I am still getting the same error noted above during auto-deploy after check-in to github (missing apollo-server-lambda). I suspect there’s something amiss in my package.json file scripts. If I can’t get that resolved I’ll enter another ticket.

Thanks again,
Jeff

So netlify dev is “test changes locally before publishing or committing”, netlify deploy is “deploy local files”. The GitHub autobuild on the other hand only works with what is in github - so for your local dev cycle, you do something like "change file, check in netlify dev, deploy with netlify deploy" you’d want us not to build when you ALSO commit to GH. But my pattern is more like:

  1. make changes
  2. check in netlify dev
  3. commit to git
  4. which causes a build & deploy
1 Like

Right, but the github workflow does not work, while the netlify deploy does. Same source code. Since the node_modules folder is typically excluded from repo check in, there’s going to be a difference in how those two flows are processed, if I understand correctly.

When I was using zip-it-and-ship-it, I had several function .js files in the functions folder, plus one node_modules folder. The utility would zip up each function into a zip archive, along with its node_modules dependencies (which, when zipped, would vary from function to function, even though they all shared one node_modules originally).

I’m going to try to fork my project, simplify it a bit, and if the results are the same, I’ll make it public so that you can reproduce it.

1 Like

that’s a good call, @JeffML!

Thanks, @perry. Here’s a simple project that you can clone to verify what I am saying:

netlify deploy works, but the github continuous deployment errors out with missing apollo-server-lamba message.

I’m having the same issue. I can only make my functions to work on production if I manually netlify deploy --prod. What are we missing? Isn’t the Netlify (github triggered or build-hooks triggered) deploy meant to take charge of that?

BTW, here’s my repo, for reference:

@paulmelero – I wrote up a little something about deployment options for netlify here. Hope it helps.

Thank you, Jeff. That is a great post! I’ll have it as reference :blush:

I figured it out: Basically it worked when I unnested the functions from its own folders. :man_shrugging:t5:

The whole point of the post was to same someone the trouble of going through the days of work it took me to figure it out. Success! :grin:

That is an amazing article and answer. + :100:

Thank you for sharing both, @JeffML. We appreciate it!