A cheap way to deploy your angular project is to use Github pages. For a long time you needed to have a
branch containing your dist code, but recently Github allowed the dist code to be in
docs which makes our life a little
easier. Bellow is a little script script to build the production version of the dist file in the docs folder.
ng build --target=production --base-href=/repository_name/ --output-path=docs
Once you ran this command, just push it on your github repo and you are done!
--target=productionis running compiling your assets for production
--output-path=docsis changing the default output from
--base-href=/respository_nameis changing your
<base href='/repository_name/', this is necessary otherwise the web server will be looking for assets under your root github domain and our site is published on the repository subdomain.