Your serverless application needs a proper CI/CD pipeline so you can easily test and deploy your application to your AWS accounts. In this video I will show you how to create such a deployment pipeline with AWS SAM Pipelines and Github Actions.
For this setup we are using OpenID Connect so we set up an identity provider in AWS and with the associated roles we can do the deployments without having to use secret access keys.
The pipeline will be triggered by a push to a specific branch (main) and it will deploy the app to the dev stage and prod stage while having steps where you can run different types of tests.
It also supports feature branches/stacks so you will have a completely independent stack for testing out new features. After the feature was properly tested you can merge it into the main branch and there is a step for deleting these feature branches/stacks.