Skip to content

Commit

Permalink
added prod pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
t-shah02 committed Feb 18, 2024
1 parent 0921ab9 commit 927c4c1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: vercel pull --yes --environment=preview --token=$VERCEL_TOKEN

- name: Build Project Artifacts
run: vercel build --token=$VERCEL_TOKEN
run: vercel build --prod=false --token=$VERCEL_TOKEN

- name: Apply All Pending Migrations To The Database
run: npx prisma migrate deploy
Expand Down
36 changes: 31 additions & 5 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,49 @@ name: Vercel Production Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
DATABASE_URL: ${{ secrets.PROD_DATABASE_URL }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_PROFILE_PICTURE_BUCKET_NAME: ${{ secrets.PROD_AWS_PROFILE_PICTURE_BUCKET_NAME }}
AWS_POST_PICTURE_BUCKET_NAME: ${{ secrets.PROD_AWS_POST_PICTURE_BUCKET_NAME }}
AWS_CLOUDFRONT_PROFILE_PICTURE_BASE_URL: ${{ secrets.PROD_AWS_CLOUDFRONT_PROFILE_PICTURE_BASE_URL }}
AWS_CLOUDFRONT_POSTS_BASE_URL: ${{ secrets.PROD_AWS_CLOUDFRONT_POSTS_BASE_URL }}
JWT_PRIVATE_KEY: ${{ secrets.PROD_JWT_PRIVATE_KEY }}
on:
push:
branches:
- main
jobs:
Deploy-Production:
Deploy-Preview:
runs-on: ubuntu-latest
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 }}
run: vercel pull --yes --environment=preview --token=$VERCEL_TOKEN

- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}

run: vercel build --prod --token=$VERCEL_TOKEN

- name: Apply All Pending Migrations To The Database
run: npx prisma migrate deploy

- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
run: |
vercel deploy --token=$VERCEL_TOKEN \
--env DATABASE_URL=$DATABASE_URL \
--env AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
--env AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
--env AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION \
--env AWS_PROFILE_PICTURE_BUCKET_NAME=$AWS_PROFILE_PICTURE_BUCKET_NAME \
--env AWS_POST_PICTURE_BUCKET_NAME=$AWS_POST_PICTURE_BUCKET_NAME \
--env AWS_CLOUDFRONT_PROFILE_PICTURE_BASE_URL=$AWS_CLOUDFRONT_PROFILE_PICTURE_BASE_URL \
--env AWS_CLOUDFRONT_POSTS_BASE_URL=$AWS_CLOUDFRONT_POSTS_BASE_URL \
--env JWT_PRIVATE_KEY=$JWT_PRIVATE_KEY \
--prod \
--prebuilt

0 comments on commit 927c4c1

Please sign in to comment.