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?
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:
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.
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.
Have you tried NetlifyCMS? https://www.netlifycms.org/
You can edit content on Netlify and it is integrated to Git workflow.
Related
I'm trying to set up CI/CD with Azure pipelines to automatically deploy a frontend vue application, but am having trouble with deploying my frontend application from it.
When deploying manually from the VS Code IDE it works fine, with the /home/site/wwwroot looking as expected in the kudu file explorer:
However when it's deploying from Azure Pipelines, it seems that the zip file remains zipped and is stored in another directory within /home/site/wwwroot/Package (e.g /home/site/wwwroot/Client/.zip), resulting in the application being unable to
This is what it looks like in the kudu powershell debugger:
My pipeline and release is pretty standard. The steps are:
Uses Node 16.x
Downloads a .env file
Copies the .env file to the directory (/client) the application is in.
runs npm install
runs npm run build
archives the dist directory that is generated from the run build command
Publishes the archived dist folder as an artifact
An Azure release is then created and deploys the artifact to the correct Azure App Service. Currently the deployment method is set to default, although I have tried each of the different deployment methods (Web deploy, Zip deploy, and Run from package) but none have worked so far.
I've downloaded the resulting zip file from the pipeline deployment, unzipped and manually deployed (using VS Code) the dist folder within which was successful, so I'm quite sure that the pipeline part of the process which installs, builds, and packages the application is working as expected, but something is going wrong during deployment.
If anyone has any ideas of what the error may be, or is able to offer any help/sugestions, it would be greatly appreciated.
Thank you.
Ensure that the archive job option for "prepend root folder name to archive paths" is disabled in the pipeline.
Also ensure the Package or folder route in the release's deploy job is correct. It should be something like:
$(System.DefaultWorkingDirectory)/______ClientPipeline/ArtifactName/*zip
I'm new at this: is there any way to let github build a page with the index.html file that is placed in a folder instead of readme?
I've been successfully building a lot of pages with that the index file isn't in a folder. But when it comes to websites that include Angular or node.js, the index file has to be in a folder so when github builds a page, the readme file appears instead of the actual site.
Is there a solution?
https://github.com/JanviaveTharwat/weather-app
That's one of the websites built with node.js. This is what appears to me after building page
https://janviavetharwat.github.io/weather-app/
https://github.com/JanviaveTharwat/angular-store-
Here is the second website with Angular. This is what happened:
https://janviavetharwat.github.io/angular-store-/
Can you help me ?
You can follow this guide for deploying Angular applications to GitHub Pages from the official Angular documentation here and the GitHub Pages documentation for the setup on GitHub itself here.
These are the steps as of Dec 23 2022:
Assuming your project already has an GitHub repository, follow these steps:
Create and checkout a git branch named gh-pages:
git checkout -b gh-pages
Build your project with the following command and flags:
ng build --output-path docs --base-href /<your-project-name>/
When the build is finished, make a copy of the docs/index.html file and name it docs/404.html
Commit your changes and push them - make sure that the docs directory is included
On the project GitHub repository, go to Settings
In the Code and automation section of the sidebar, click on Pages
Under Build and deployment, under Source select Deploy from a branch
Under Build and deployment, under Branch and select your gh-pages branch
Use the drop-down to the right of the branch drop-down to select the docs folder
Click Save. Your application should now be deployed and accessible under https://<user_name>.github.io/<project_name>
I'm unsure how to deploy my web application to heroku where the actual web application is generated within a sub folder. I have the project tree:
app
assets
dist
server
// other stuff ....
now when I want to run my server & frontend, I do gulp. gulp creates a folder named build which contains all needed files for running the web app, so my file tree would become
app
assets
dist
server
build
// other stuff ....
Is there a way to initialize the heroku repository to only the folder build? Since my actual web app lies inside just that folder, it's probably easier for me to only have heroku think the build folder exists.
I currently have heroku setup with only heroku create inside the parent repo
I found a solution to my issue. What I decided to do was include my build folder into my repository (did not add much bloat, only like 50kb). Then, when I wanted to deploy to heroku I did:
git subtree split --prefix build -b deploy
git push heroku deploy:master
git branch -D deploy
this created a branch with only the build folder, pushed that to heroku (use -f if you need to overwrite previous commits), the deleted the deploy branch.
Worked like a charm!
I'm trying to find information online about how to deploy an angular2 with webpack app to azure, but I couldn't find anything helpful enough. I checked the start package as suggested here How do you deploy Angular 2 apps? but I also couldn't find much help there.
So, I have an angular2 app running with webpack locally. It's working perfectly locally. But how do I deploy it to Azure Web Apps?
I appreciate any help :)
Thanks!
Well, so I was able to get it working.
After researching I found out there are a few options to go by, mainly creating your own local prod build and uploading it and using CD/CI. I went with the latter. It took quite some time, but now it's all set I don't have to worry about it anymore...
I based myself in this tutorial http://tattoocoder.com/angular2-azure-codeship-angularcli/ by Shane Boyer but since link-only answers are discouraged I'm going to write it here.
Here's how I did it:
Create a branch release on GitHub (I use this one to publish)
Create a free account on CodeShip and import the GitHub repo
On Configure Project select I want to create my custom commands and use this code:
nvm install 4.1
npm install angular-cli
npm install
Then this one under Test pipeline:
ng serve &
ng e2e
ng build -prod
Click Save and go to dashboard
Now go to your Azure Portal (https://portal.azure.com/) and open/create your web app
Click on Deployment Options > Choose Source > Local Git Repository
Then click on Deployment Credentials and insert the user/password you prefer
Click on Overview and copy your Git clone url
Go to Project settings > Environment variables and add AZURE_REPO_URL with the value being the git clone url you copied with the user/password (https://username:password#site.scm.az(...).git):
After, click on Deployment on the left navigation menu
Choose the branch you want to deploy from (in my case it was release) and click Save, then click on Custom Script
Then customize and add this script:
git config --global user.email "email#provider.com"
git config --global user.name "Your name"
git clone $AZURE_REPO_URL repofolder
cd repofolder
rm -rf *
cp -rf ~/clone/dist/* .
git add -A
git commit --all --author "$CI_COMMITTER_NAME <$CI_COMMITTER_EMAIL>" --message "$CI_MESSAGE ($CI_BUILD_URL)"
git push origin master
That was it. Now every time you push to GitHub CodeShip will build your code and every time you PR to release it will build AND publish to azure.
Thank https://stackoverflow.com/users/595213/shayne-boyer for this.
I installed GithubHQ in one server and GitlabCI in another server. But now I need do integration between GitlabHQ and GitlabCI. When I go to add a new project in GitlabCI he requests a path .git project, but the project is on another server where the GitlabHQ.
I tried use the path remote, like: http://[domain-name]/[user]/[project].git but he not accept.
I researched about how GitlabCI search the path and found that it does not support remote paths. He use "Rugged::Repository.new(path)" just to get the project on the server.
Does anyone know a way to use paths .git remotes in GitlabCI?
As illustrated by Issue 36:
Actually the purpose of gitlab-ci implies that you install it on deployment point. You install it where you deploy your project
So you are supposed to use a local non-bare repo.
You could, in your case, clone your remote repo on the gitlab-ci server, and use that local path.
In order to build an integration between gitlab and gitlab-ci:
add gitlab_ci user to git group for read access
clone your project via git clone /home/git/repositories to somewhere like /home/gitlab_ci/projects/...
add this project to ci.
setup gitlabhq to use ci service
Thats all.
On gitlab push it will trigger gitlab ci to make git fetch origin, so testing repo will be always up to date.