Skip to content

Commit

Permalink
Add GH action to deploy to AWS using serverless
Browse files Browse the repository at this point in the history
  • Loading branch information
hammady committed May 18, 2024
1 parent 3a0e4a4 commit e7c16a1
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/serverless-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Github action to deploy serverless app

name: Deploy service to AWS using serverless framework

on:
push:
branches:
- master

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ vars.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: '19.x'
- name: Install serverless framework
run: npm install -g serverless
- name: Install node dependencies
run: npm ci
- name: Install python3.9
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Package and deploy
run: |
serverless deploy \
--region ${{ vars.AWS_REGION }} \
--stage ${{ vars.SLSSTAGE }} \
--verbose

0 comments on commit e7c16a1

Please sign in to comment.