How to update files on my website without using FTP client? - node.js

I uploaded static files on Nginx + NodeJS. The only way I know how to update the website is using an FTP application.
Is there some other way of uploading website assets?
Is there a package that allows commits in GitHub to automatically update my website in Nginx?
What are the best practices for updating websites? I tend to avoid CMS as much as possible as I'm only updating the website a few times only.

It all depends on how you’re hosting your site. Some services provide their own tools for updating content within them. For example if we host our site in a docker deployment in aws ecs, then we would use aws commands to get that done.
If you’re fine with ftp, then you can create a GitHub action workflow to automatically update your site
You can take a look at the sample pipeline I provided as a response in this post for reference on how the workflow would work
https://stackoverflow.com/a/63731446/14167216

Related

Where can I see the files for a Azure static web app? Image file doesn't seem to have been deployed

I'm playing around with Azure Static Web Apps and have built a simple Blazor App which I've deployed. I added a Contacts page with an image that appears when built and running in Visual Studio but the image is missing when the app is is deployed via a GitHub Workflow Action. I've checked the file is present in the GitHub repo. I'm just using the free version of Azure static web apps for testing and believe the files are deployed to blob storage.
I can see two similar related questions to my problem but neither of them provide a solution to my issue
Is there a way to view files in Azure Static Web App?
Azure static web apps not loading page resources correctly. css or javascript files
As per the link to the first question above, is there a way to see the files deployed to check if the file is actually there? Everything I'm seeing tells me it's not! - the image is not showing and copying the link to a new window gives me the usual file not found. Link looks absolutely spot on - https://madeupbit.azurestaticapps.net/FundXWebTelNo1.png. I deliberately moved the file out of a separate images directory into the root to eliminate any of the possible issues mentioned in the second question linked above.
And I guess the second question is if it's not there, how do I get it there seeing the automated GitHub Workflow Action ain't doing it. Of course there may be something else going on so any suggestions welcome!

How does Firebase manage versions in Firebase Hosting?

Firebase hosting instantly makes available a new version of your website the moment you deploy it. At the same time, you are able to instantly roll back to a previous version. Usually a CDN requires several minutes before changes are propagated and the same applies for .htaccess files or similar that could do redirects making me think that they have a dynamic extra layer on top of the CDN. If they do, how might they handle the DNS stuff?
You have a custom domain name that uses a CNAME to reach Firebase's mysite.web.app and Firebase probably uses a CNAME to forward to Fastly's (Firebase's CDN provider based on a network lookup) domain e.g. firebase-customerid-mysite.fastlycdn.net
I can't exactly figure out how they deal with the instant version changes. They must use different folders in the CDN but I don't think they use a different subdomain for each version as that would require a new certificate etc and would not be so fast. So how do you redirect a whole domain to a subfolder? You could do that by changing the .htaccess file but that would also require several minutes. How do you think they do it?
Thanks in advance!
As far as I can sum it up firebase version change is similar to that of a git so no they don't create a different directory to deploy your latest version they just save the previous version in the .firebase or something folder (version control directory) and the subdomain doesn't change. Instead, the latest version gets deployed which changes we can see immediately due to no-cache which generally needs to be validated with the origin server before each reuse. So when the browser asks fastly, it checks with the firebase server if the resource has changed and if yes a new version of that resource is provided.
References:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
https://firebase.google.com/docs/remote-config/templates
https://docs.fastly.com/en/guides/how-fastlys-cdn-service-works
To achieve a similar result one can use git for version control (changes in real-time) and use the no-cache header (for resource validation). We can use any CDN as nearly all of them validate the resources.

Visual Studio ClickOnce Web Deployment

I would be most grateful if anyone could help me solve this problem with ClickOnce Web deployment.
I have read all the threads on this subject and I have also read through all the Microsoft documentation on the subject. They seem to say a lot without actually being direct or providing helpful examples. However, perhaps I am wrong and I have not looked in the right places.
I have already used ClickOnce successfully to deploy an application on the local area network.
It works well and really isn't that complicated. However, my goal is to deploy this application to customers, who are not connected to my local network.
I have set up a web site (www.mydomain.co.za), which I can access directly or via the ftp protocol.
I have created a sub directory off the root where I intend to publish the files created by the publish function. The publish function of the application requires a Publishing Folder Location and a Installation Folder URL I don't really understand the functional difference between these two locations. If I set the Publishing Location to ftp://www.mydomain.co.za/MyProductName and the Installation Folder URL to http://www.mydomain.co.za/MyProductName, then the publish process succeeds and when I check on the web server, the files have been published successfully it would seem. A further Application Files/MyProductName subdiectory with the version number information appended was created where all the output was placed.
My next step is to then grab the URL of the setup.exe file and to run it from a browser. This downloads the setup.exe file to my downloads folder which I then try to run but I get an error
Deployment and application do not have matching security zones.>
I have seen this come up in other threads but These threads don't seem to relate directly to what I am trying to do. These threads make mention of using Internet Explorer to achieve some degree of success, but all the browser did was to download the file.
I have also noted with interest that a web page is created in the root with a button that prompts the user to install the application. This does not work either.
Does anyone know of an article that I can read on this subject which is more helpful or if anyone can offer more insights into this I would be very grateful.

How do I deploy static assets from VSTS to multiple applications?

Apologies if this question has already been answered. I've tried looking around, but may not have done a great job!
My azure deployment consists of 4 web sites deployed from VSTS that all share common web assets hosted on an Azure CDN. I would like to create a single "build" (or release) in VSTS so that I can build all the client-assets at once and deploy them to the CDN endpoint as well as the 4 running app services for fallback.
My initial approach used FTP tasks for the web servers. This worked but took almost an hour to ftp 500+ files to each website. I then attempted the approach mentioned here. Though I was able to zip up the assets, my drop file had the structure of:
- assets
- WebAssets.zip
Eg. "WebAssets.zip" was just a compressed copy of "assets" and I was unable to deploy this file to the proper location on the websites, "/site/wwwroot/wwwroot".
Is there a better way to copy these assets to each web service? Here is the structure of the "ftp" version of copying the assets:
Any help or direction pointing would be appreciated.
Update: just wanted to clarify that the current process does indeed work. It just takes between 30min and an hour to complete. I just want to make sure I am doing it correctly and that there is not a better way.
With Azure App Service Deployment task, you need to check Publish using Web Deploy option if you want to extract the zip folder.
On the other hand, to improve the performance, you can setup a private build agent that has the high performance (e.g. Network, Memory, CPU)
Deploy an agent on Windows

Using MsDeploy to create web site or virtual directory

We're trying to figure out how to automate our website deployment. We've picked an existing project, and started playing around.
First, I used the Publish wizard from with VS2012 to create a Web Deploy Package. We then tried deploying the package as a website, through the IIS Manager, and that succeeded without a problem. We thought we were nearly there.
What was next was to learn how to run this from the command-line, so we could script it. And that's caused us no end of headaches.
We've been playing around with msdeploy.exe, and with the .cmd file that the publish wizard created, and while both methods seem to install the package as a virtual directory just fine, neither will install the package as a root website.
Browsing around on the web, I've run across this:
Web Deploy iisApp Provider
In a sync operation, the iisApp provider copies content to a folder under the destination site that you designate and marks the destination folder as an application. The iisApp provider cannot create a site. The iisApp provider will not create applications under sites that do not exist.
And
If you want to synchronize a Web site and its related configuration, use the appHostConfig provider.
At this point, we don't know beans about iisApp, or appHostConfig, or whatever. We didn't create a package that used one or the other, VS2012 did. We haven't a clue, at this point, how to convince VS2012's web publish to create an appHostConfig package, and for that matter, I don't know if we want to.
Here's the thing - whether a given website is installed as a root application or as a virtual directory is not something the developers control - it's a decision made by the implementation team. Or testing team usually installs any given website both ways, to ensure that both work.
And since IIS seems to be able to manage to install this package as a root site, there must be a way to get msdeploy to do it.
But how?

Resources