Alula ሐawando

How I setup my website on github and Cloudflare

The repository for this website is on Github. Everytime I make a change that might be as simple as a typo or as complex as adding a new module, I just push the code from my local environment.

Yes, a simple git add *.md, followed by git push. That is it.

Then, the change is immediately reflected on this website.

I find this fascinating because I have deployed applications on CPanel and on Glassfish, using manual war files. Cloudflare abstracts all the infrastructural and software needs to build and deploy our application using what they call Workers. Of course, this is what is also also called serverless, a term I personally don't like.

If you have a website or a full-stack application on github like this, you can set it up so that Cloudflare can build and deploy it everytime you push a code to github. It is not as complicated as it sounds.

All you have to do it navigate to the dashboard of Cloudflare and click Workers and Pages. Then You create a page by clicking the Create application > Pages > Connect to Git. Here is a [detailed documentation on how you can do this] (https://developers.cloudflare.com/pages/get-started/guide/#connect-your-git-provider-to-pages).

Why you want to consider Github with Cloudflare

The code for your website or application doesn't necessarily have to reside on Github. There are other Git providers. For example, on my current 9 to 5 job I use BitBucket, and it is equally alright. Previously, I have worked with Azure and GitLab and that is another alternative.

So with regards to hosting your application, you definitely can not go wrong as long as you go with a git providing platform.

Once you have your repository setup, you can configure deploy and build setup on Github and have everything there. Alternatively, you can take it to Cloudflare.

The first time I tried Cloudflare was around 2016, for my web agency website, businesstyc. At the time, the main benefit I was after was performance and later security.

Still Cloudflare is a wonderful platform just for that reason. It provides protection from DNS spoofing, SQL injection, cross-site script attacks, DDOS attacks, etc.

Furthermore, Cloudflare is a CDN (Content Delivery Network), which is a geographically distributed proxy server that makes content delivery very fast. Through its servers it caches all the static content of your site, and/or application and reduces latency. My website is 100% at the time of this writing on Google page insight and I am proud of that.

But recently, Cloudflare has become more than CDN, it is a build and deploy platform like Microsoft Azure, Netlify, and AWS. It also provides other services like a key-value store, an S3 like object store and a database. But those are topics for another day.

Hence, if performance and security was not enough persuasion for you, I hope the code and deploy feature will make you consider cloudflare. It is worth your time and the minimal effort you will put into it.