Published:May 5, 2020
Updated: November 15, 2023
Views: 110
Netlify has become a go-to hosting service for deploying static sites, thanks to its integrated continuous deployment. If you're unfamiliar with static sites, we recommend reading our post on why we prefer static sites over database-powered ones.
Netlify offers a free package that caters to the needs of freelancers and small companies, but it also provides paid packages for larger teams requiring more functionalities. The setup is straightforward, and the deployment process is impressively fast. Within a minute or so, your site is deployed and ready for production.
Connecting the domain to the nameservers is also a simple task without any complications. The current nameservers of Netlify are:
dns1.p02.nsone.net
dns2.p02.nsone.net
dns3.p02.nsone.net
dns4.p02.nsone.net
To see a static site hosted on Netlify in action, check out www.barneysbrunch.house. You'll notice that the website loads swiftly, thanks to HTML files already deployed on the server. This setup allows the server to immediately deliver the HTML and CSS files, which are about 300-700kb in total. The estimated load time is around 2 seconds on the first load, and with caching, the loading time drops to almost half a second.
Wondering if we manually upload the files to Netlify for deployment? The answer is no. All our projects are stored in Github, either as private or public repositories. All the code and changes are saved on GitHub. The repository is then connected to Netlify, and the deployment starts when changes are made.
We make a change to the code, commit the change, and push it to the master branch on Github. Netlify then detects the change and starts deploying the code for production. The website reflects the new code once this process is complete. This entire process, which is almost entirely automated, is completed within 3-5 minutes. The developer's task is simply to initiate the process with the commit and push to master.
How does Netlify know that a change was made on GitHub? By following the guidelines on the Netlify website, we establish this connection. The process is quick and simple. By authorizing Netlify to access your GitHub repository, changes are sent as notifications to the server, and the deployment process begins.
Do we always need to go through the entire process whenever we want to make a change? The answer is both yes and no. Yes, if that's the only change you want to make. No, if you plan to work longer on the code. In the latter case, you can check your changes locally and, after you're done with all the changes and multiple commits, you can go through the process of deployment for production.
Another noteworthy feature is the use of a netlify.toml file, which allows for further modifications. We use it to notify Netlify of the PHP version we want to use for a specific repository. It can also be used to control the assets' optimization settings as part of the build process. You can customize pretty URLs, minify CSS or Javascript, and compress images, among other things.
Let's say you made a change, the deployment process was completed, but your website crashed. You're unsure of the problem and don't know how long it will take to solve the issue and redo the entire process. Don't worry, Netlify offers the option to cancel your latest deployment and revert to the previous one, which was likely successful.
In conclusion, Netlify offers a robust, user-friendly platform for deploying static sites. Its seamless integration with GitHub, fast deployment times, and flexible options for making changes make it a top choice for developers. For more insights into our development process, check out our case studies.
This article is part of the "Which technologies do we use and why?" series where we explain the technologies that we use daily.
If you need help with a Laravel project let's get in touch.
Lucky Media is proud to be recognized as a Top Laravel Development Agency by Clutch, a leading B2B ratings and reviews platform.
At Lucky Media, we offer a range of services including website development, web application development, and mobile apps development. We specialize in Statamic, React Native, Next.js, AI and ML solutions. We also provide staff augmentation and TALL stack development services.
For more insights into our work, check out our case studies on revolutionising lead generation with AI, customized coaching site, healthcare digitization, next-level performance, lead generation and patient journey, WordPress to Statamic migration, and improving user experience. These case studies provide a glimpse into how we tailor our technology choices to meet specific client needs and deliver exceptional results.
Related Posts
Stay up to date
Be updated with all news, products and tips we share!