diff --git a/.github/workflows/deploy-prod.yaml b/.github/workflows/deploy-prod.yaml index 5e60202..f9a1768 100644 --- a/.github/workflows/deploy-prod.yaml +++ b/.github/workflows/deploy-prod.yaml @@ -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: diff --git a/.github/workflows/seed-db.yaml b/.github/workflows/seed-db.yaml new file mode 100644 index 0000000..12e1304 --- /dev/null +++ b/.github/workflows/seed-db.yaml @@ -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 \ No newline at end of file diff --git a/.github/workflows/serverless-deploy.yaml b/.github/workflows/serverless-deploy.yaml index c0bfef2..9bd3c2d 100644 --- a/.github/workflows/serverless-deploy.yaml +++ b/.github/workflows/serverless-deploy.yaml @@ -2,7 +2,6 @@ name: Deploy to AWS on: workflow_dispatch: - inputs: ENVIRONMENT: description: 'Environment to deploy to'