vercel deploys #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Prod deploy | |
on: | |
push: | |
branches: ["master"] | |
jobs: | |
aws_cdk_deploy: | |
name: CDK Prod Deployment | |
if: github.event_name == 'push' | |
environment: production | |
runs-on: ubuntu-latest | |
env: | |
DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
ENV: dev | |
SQS_QUEUE_URL: ${{ secrets.SQS_QUEUE_URL }} | |
RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "npm" | |
cache-dependency-path: ./package-lock.json | |
- name: Install dependencies | |
run: npm install --legacy-peer-deps | |
- name: Install AWS CDK | |
run: npm i -g aws-cdk | |
- name: Configure aws credentials | |
uses: aws-actions/configure-aws-credentials@master | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} | |
aws-region: "eu-west-2" | |
- name: Synth stack | |
run: cdk synth | |
- name: Deploy stack | |
run: cdk deploy --all --require-approval never | |
vercel_prod_deploy: | |
name: Vercel Prod Deployment | |
runs-on: ubuntu-latest | |
needs: [aws_cdk_deploy] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Vercel CLI | |
run: npm install --global vercel@latest | |
- name: Pull Vercel Environment Information | |
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Build Project Artifacts | |
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Deploy Project Artifacts to Vercel | |
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} |