Jesse Reza Khorasanee
Jesse Reza Khorasanee

Reputation: 3481

How to change a Netlify file after Build

Is it possible to change a file on Netlify after the site has already been built?

Example:

If I have a site: https://physiome-test.netlify.com/simple_heart/ that accesses a file at

https://physiome-test.netlify.com/simple_heart/models/organsViewerModels/cardiovascular/heart/ecgAnimation.json

Is there any way that I can change this file without having to update my github repository?

Upvotes: 1

Views: 15461

Answers (3)

Elena
Elena

Reputation: 41

The netlify-cli can deploy directories without modifying a git repo.

Here is an example usage:

npm run build
netlify status
netlify deploy

and if everything looks good on your draft URL, take it live with the --prod flag.

netlify deploy --prod

Everything will update automatically.

Upvotes: 4

talves
talves

Reputation: 14353

Is there any way that I can change this file without having to update my github repository?

Using Netlify continuous deployment, which is what you are doing, you can't just change one file on Netlify without changing the files in your git repository that is tied to building your build process.

Process Netlify uses:

  • On commit trigger (webhook from GitHub) or a trigger deploy in the app.netlify.com admin
  • Checkout your target branch
  • Runs your build command
  • Compares your current build to existing CDN contents
  • Updates global CDN for changed files in your target deploy location

Changing Netlify Files without changing git

A new feature allows you to drag a deploy folder to app.netlify.com for fast review/deploy without using your git repository. Go to the Deploys tab of the site you want to update. You will see a message at the bottom like the pic below:

enter image description here

Drag your deploy folder to this location from your local system and your site will be updated with any new files on Netlify.

Note: All the files of your site must be in the folder with your current changes.

Upvotes: 7

RedPandaz
RedPandaz

Reputation: 6286

Have you tried NetlifyCMS? https://www.netlifycms.org/ You can edit content on Netlify and it is integrated to Git workflow.

Upvotes: 2

Related Questions