Let’s make it public — From localhost to public URL
Hey folks, today will cover an exciting but rarely shared topic — DEPLOYMENT.
There are plenty of sites, videos, blogs, and whatnot to learn hundreds of coding languages around the web.
I definitely think it’s a blessing for anyone who wants to brush up on their technical skills but one thing that comes with any new learning is that every minor step feels like an achievement to us. And why not, you’ve taken a step in a good direction.
With this amazing feel comes a desire to share what you’ve built out of thin air with your friends, colleagues, or even the internet for that matter.
So today will discuss an amazing service that will help you take your localhost website to a public URL without crunching the DevOps knowledge or without paying a penny to AWS/GoDaddy.
Netlify — “Net” and “Simplify”
At first glance, you’d be forgiven for thinking that Netlify was a static web hosting solution. It is, but it goes so much further.
Netlify is a service that automates builds, deployments, and manages your websites. It’s one of the fastest and easiest deployment solutions these days.
Netlify offers a free plan. So first, we will log in to Netlify using any one of the options(Github, Gitlab, Bitbucket, Email) given on the login page.
Once, you are logged in you would land on the dashboard page which looks something like this as I am writing this.
Don’t get overwhelmed, I promise it gets simpler by the end of our discussion.
Let’s add a new site within 5 minutes -
Netlify gives you 3 methods to deploy any website
- Drag & Drop (Manual way — create a build and just drop it)
- Netlify CLI (Controlled way — netlify CLI commands)
- GitHub Integration (Automatic way — Deploy newer version just with simple git push)
It totally depends on the user’s preference on which you want to proceed but I am going with the Github integration path which is completely automatic and simple.
STEP 1
Connect your GitHub repo with netlify and give the needed permissions.
STEP 2
Once connected,
you will get the list of your repo’s either all or the ones for which you have provided permission to netlify
STEP 3
This is the final step in this process and you might want to pay focus on this part, as we might have different git branches, commands to build our project, or any env variable we want to use.
Select the specific branch you want to deploy, for instance — master
Next, Fill in specific directory details and build commands if any based on your project else left blank
Once done, Hit Deploy.
You’ll see a success card once Netlify is done
It has a public URL that you can share with your friends, family, or colleagues and show your cool work. All of that is free of cost with ease.
All of this is a one-time process,
For the upcoming builds just push the changes to the master branch and Voila! Netlify will handle everything.
Note: Just be aware that only push those changes to the specified branch that you want to deploy.
Note: Netlify automatically secures your site over HTTPS for free.
That’s all there is to it. On netlify.com you can see your site settings. There you can do stuff like set up a custom domain or connect the site to a GitHub repository.
Find me on https://dulcet-banoffee-8deaf1.netlify.app/
My own portfolio site is deployed using netlify. I personally love the tech which makes life easier and definitely Netfify is one of that pieces.
I hope you’ve found this post informative and helpful. I would love to hear your feedback!
Thank you for reading!