Continuous deployment

You can enable continuous deployment of the changes in your source repository to an AWS account.

Note

It is optional to keep the deployment in your account automatically synchronized with the source code repository.

For the continuous deployment to work, you need to fork the source code in order to register the webhook listener that triggers an upgrade of your deployment.

After forking, make sure to update the repository.url in the package.json file in your fork.

This sets up an AWS CodePipeline, which triggers a CodeBuild project for every push to the saga branch. You can configure the branch in the deploy.branch property of the package.json file. The CodeBuild project upgrades the CloudFormation stack, which contains the Bifravst resources.

A second CodePipeline will be set up for the web application, which triggers a CodeBuild project for every push to the saga branch. You can configure the repository URL and the branch for the web app in the deploy.webApp property of the package.json file. The CodeBuild project upgrades the web application deployment on the S3 bucket.

Provide GitHub credentials

You need to create a developer token with repo and admin:repo_hook permissions for an account that has write permissions to your repository.

Note

It is recommended to use a separate GitHub account instead of your personal GitHub account.

You need to store this token in AWS ParameterStore and it is a manual one-time step done through AWS CLI by using the following command:

aws ssm put-parameter --name /codebuild/github-token \
    --type String --value "<Github Token>"

Enable continuous deployment

After providing the GitHub credentials, you can set up the continuous deployment by enabling it through the context switch cd:

echo "cd=1" >> context.cfg
npx cdk deploy '*'

Check the status of the Continuous Deployment

If you want to check the status of the continuous deployment after you have made the changes, use the following CLI command:

node cli cd

Below is a sample output generated by the command:

Output of node cli cd

Output of node cli cd