Skip to content

Db change (#94)

Db change (#94) #32

Workflow file for this run

name: Deploy to Production
on:
push:
branches: [ "main" ]
jobs:
migrate-db:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install dependencies
run: npm install
- name: run migrations
run: |
echo "${{ secrets.ENV_FILE }}" > .env
echo "Running migrations"
npm run db:up
deploy-lamda:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Install AWS CDK and compile
run: |
echo "installing aws-cdk and compiling"
echo "${{ secrets.ENV_FILE }}" > .env
npm install -g aws-cdk
npm install
npm run build
- name: Synthasize CDK stack
run: |
echo "synthasizing CDK stack"
cdk synth
- name: Build and deploy CDK stack
run: |
echo "deploying CDK stack"
echo "${{ secrets.ENV_FILE }}" > .env
cdk deploy --all --require-approval never
echo "CDK stacks deployed"