Skip to content

Commit

Permalink
refactor: make the deploy prod have a soak time
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardobridge committed Jan 23, 2024
1 parent e2f490f commit f24df5d
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 10 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/deploy-prod.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
name: Deploy to prod

on:
push:
branches:
- master
paths:
- handlers/*
- constants.js
- serverless.yml
- package.json
- package-lock.json
workflow_dispatch:
schedule:
# every monday at 6:00 AM UTC
- cron: '0 6 * * 1'

jobs:
deploy-prod:
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/seed-db.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Seed DynamoDB

on:
workflow_call:
inputs:
DEPLOYMENT_REGION:
description: 'AWS region to deploy to'
required: false
default: 'us-east-1'
type: string
ENVIRONMENT:
description: 'Environment to deploy to'
required: true
type: string

permissions:
id-token: write
contents: read

jobs:
deploy-to-env:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- name: Seed DynamoDB - ${{ github.event.inputs.ENVIRONMENT }}
run: npm run seed
env:
DEPLOYMENT_REGION: ${{ github.event.inputs.DEPLOYMENT_REGION }}
ENVIRONMENT: ${{ github.event.inputs.ENVIRONMENT }}d
1 change: 0 additions & 1 deletion .github/workflows/serverless-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Deploy to AWS

on:
workflow_dispatch:

inputs:
ENVIRONMENT:
description: 'Environment to deploy to'
Expand Down

0 comments on commit f24df5d

Please sign in to comment.