Automate a Full-stack Application Deployment Using GitHub Actions
#githubactions #git #reactjs #expressjs #virtualization #fullstackdevelopment #githubrepository #statemanagement
I have always found this to be a challenging task, getting website contents to a remote web-server. Building locally seems to work, you get the outputs you expect but then there comes the challenge of getting this content to the internet or world wide web(WWW). There are a few options that we may consider,
2. Using a free web hosting tier provided online.
3. Using your own online web-server.
I have never tried the first option given. I have used the second option but this comes with its own pro and cons. It is free space that you are given but the disadvantage is, if its a full stack app that you are trying to upload then there are limitations on the language that the provider is using compared to what you have used. Using the third option is what has worked for me over the years, getting a virtual private server(VPS) or some may call it as a cloud server, installing the operating system and the services we need running on the VPS, in this case , web-hosting service.
Now, the most daunting part is getting content to the VPS, there are so many things we need to do and they also become repetitive, below is what I do;
What if your customers grow in number? All the above works but is there a simpler way to accomplish all these steps? I had to deal with this challenge until I knew about GITHUB WORKFLOWS/ACTIONS. This has helped semi automate the above processes.
领英推荐
This GitHub repository https://github.com/bradtraversy/proshop-v2 by Brad Traversy is a full stack MERN(mongoDB,express,reactjs,nodejs) application that I have cloned to show the proof of concept, I have created a GitHub workflow to automate the process and below are the steps;
Now it is just a matter of me making the edits in my local repository and when the changes are pushed to GitHub, this triggers the all the steps hence automating the process. After every change commit and push to GitHub the steps are triggered.
https://www.raliku.com is the working full stack MERN web application.
Check out the repo https://github.com/anapitalai/raliku-holdings. All the steps are in the above repo under .github/workflows/automate.yaml.
Knowledge is information, understanding is comprehension and application is wisdom.(Dr Myles Monroe). May God bless you.
--
1 年Wonderful article Alois Napitalai , been facing the same challenge as well. Will fork the mention repo and try it out.