In a previous post, I wrote about continuous integration and continuous deployment pipeline using CircleCi.
Setting up IAM Credentials
Since the project will be connected to the AWS S3, we need to give access by creating IAM credentials. Proceed to your IAM dashboard and create a user IAM credentials.
Note: You must give programmatic access and keep the access key and secret key safe.
Give Amazon S3 Full Access
Setting up the Environment variable
Proceed to the CircleCi to set up the environment variable with the AWS Access key and Secret key
Create an S3 Bucket
Give a unique bucket name and specify an AWS region the same as in the CircleCi environment variable
Connect to CircleCi
Set up projects on CircleCi via your repo.
Configure the config.yml file in the repo, then set up the project.
name: Installing AWS CLI
sudo apt-get update
sudo apt install python3-pip
sudo pip3 install awsebcli --upgrade
- run: cd ./app && npm install && npm run build
- run: cd ./app && npm run test
- run: aws s3 sync ./app/build s3://circleci-demo-cicd
After successful deployment, the artifacts are stored in the S3 bucket.
You can preview the stages of the build, test, and deployment.