DEV Community

Lorna Watson
Lorna Watson

Posted on • Updated on

Continuous Deployment using GitHub and Netlify ๐Ÿ˜Ž

I've found myself recently having an interest in all-things devops. I researched very briefly into how to setup continuous deployment using Netlify and integrating this with GitHub. From project creation to deployment, Netlify gave me the tools I didn't know I needed to quickly and easily deploy a website. The aim of this post is to show how to deploy a basic Angular app within 5 minutes.

enter

Quickest way to create a new project is to use the Angular CLI.

cd C:\Users\lorna.watson\Documents\Projects\Workspace
ng new angular-netlify
cd angular-netlify
Enter fullscreen mode Exit fullscreen mode

Push your new angular project to a new GitHub repository with all changes. Now install the Netlify Builder package and you will be prompted to enter both API ID and personal access token from your newly created Netlify site. If unsure how to find this, check out the link above.

ng add @netlify-builder/deploy
Enter fullscreen mode Exit fullscreen mode

I haven't began to explore what's possible with Netlify yet - only just touched the surface. I signed up using my GitHub account and once signed in clicked the New site from Git button. Go through the mini wizard where you can connect your new Netlify site with your chosen GitHub repository.

Almost there. Change your build command and publish directory accordingly.

Build command:

ng build --prod
Enter fullscreen mode Exit fullscreen mode

Publish directory: (can also be found looking in /angular.json at the output path)

dist/angular-netlify
Enter fullscreen mode Exit fullscreen mode

And let's deploy baby...

ng deploy
Enter fullscreen mode Exit fullscreen mode

enter

Thank you for reading, hope this post was useful ๐Ÿ˜ƒ๐Ÿ™Œ

Top comments (0)