Skip to content

Commit

Permalink
Add GitHub Actions workflow for deploying SAM application
Browse files Browse the repository at this point in the history
  • Loading branch information
yakhousam committed Jan 22, 2025
1 parent d6e27ca commit da7e9f8
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/deploy.yml
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 }} \

0 comments on commit da7e9f8

Please # to comment.