-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Actions workflow for deploying SAM application
- Loading branch information
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Deploy SAM Application | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "20" | ||
|
||
- name: Install Esbuild Globally | ||
run: npm install -g esbuild | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
working-directory: nodejs | ||
|
||
- name: Run tests | ||
run: npm test | ||
working-directory: nodejs | ||
|
||
- name: Set up AWS CLI | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.AWS_REGION }} | ||
|
||
- name: Install AWS SAM CLI | ||
run: pip install aws-sam-cli | ||
|
||
- name: Build SAM application | ||
run: sam build | ||
|
||
- name: Deploy SAM application | ||
run: | | ||
sam deploy \ | ||
--no-confirm-changeset \ | ||
--no-fail-on-empty-changeset \ | ||
--resolve-s3 \ | ||
--stack-name invoicing-app-clients-microservice \ | ||
--capabilities CAPABILITY_IAM \ | ||
--parameter-overrides UserPoolId=${{ secrets.USER_POOL_ID }} UserPoolClientId=${{ secrets.USER_POOL_CLIENT_ID }} \ |