Skip to content

Commit

Permalink
chore: Add github action serverless deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
lsjbh45 committed Jul 12, 2023
1 parent 84a84f5 commit 7095cac
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: serverless deployment

on:
push:
branches: [master]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install dependencies
run: npm install --only=prod
- name: Configure credentials
run: serverless config credentials --provider aws --key $AWS_ACCESS_KEY_ID --secret $AWS_SECRET_ACCESS_KEY
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Set environment variables
uses: jsdaniell/create-json@1.1.2
with:
name: '.env.prod.json'
json: ${{ secrets.ENV_PROD_JSON }}
- name: Deploy
run: npm run deploy

0 comments on commit 7095cac

Please sign in to comment.