Setting up CI/CD with AWS CodePipeline and CodeBuild for Angular 8 serverless website (AWS Cloudfront and S3)

  1. I really loved my build and deploy experience for frontend with Angular and Bootstrap except I was disappointed that SPA’s don’t do very well with web crawlers and SEO. For this project I don’t care about that so much.
  2. Since I want this project’s backend to be absolutely serverless, I will be using AWS API Gateway and AWS Lambda and if required AWS DynamoDB (another article for those). Since this is a personal project this will keep costs down and also I get to learn some cool serverless technology. By the way for AWS Lambda code I will use either Python 3.6 or Go 1.13
(proj_venv) my-MacBook-Pro:proj me$ ng — versionAngular CLI: 8.3.17Node: 10.9.0OS: darwin x64Angular:...Package                      Version------------------------------------------------------@angular-devkit/architect    0.803.17@angular-devkit/core         8.3.17@angular-devkit/schematics   8.3.17@angular/cli                 8.3.17@schematics/angular          8.3.17@schematics/update           0.803.17rxjs                         6.4.0
Aah! Makes me happy…I guess this was the easy part.
(proj_venv) my-MacBook-Pro:project me$ pwd/Users/me/me/project(proj_venv) my-MacBook-Pro:project me$ git remote add origin https://github.com/<user>/<project>.git(proj_venv) my-MacBook-Pro:project me$ git remote -vorigin https://github.com/<user>/<project>.git (fetch)origin https://github.com/<user>/<project>.git (push)
(proj_venv) my-MacBook-Pro:project me$ git push -u origin master
ng build --prod=true --aot
version: 0.2phases:
install:
runtime-versions:
nodejs: 10
commands:
- npm install
- npm install -g
@angular/cli
#pre_build:
#commands:
# - command
# - command
build:
commands:
- ng build --prod=true --aot
post_build:
commands:
- aws s3 cp dist/<projfolder>/ s3://<yourbucketname> --recursive

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store