From 60dc8a4950a3d693cd168f004e2d96a3dc644e0d Mon Sep 17 00:00:00 2001 From: Appu <77108939+appujet@users.noreply.github.com> Date: Tue, 8 Oct 2024 11:42:19 +0530 Subject: [PATCH] Update deploy.yml --- .github/workflows/deploy.yml | 41 ++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1e40f96..8889143 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,24 +1,33 @@ -name: Deploy to Vercel on Release +name: Vercel Production Deployment + +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} on: release: - types: [created] # Triggers the workflow when a release is created + types: [created] jobs: - deploy: + Deploy-Production: runs-on: ubuntu-latest steps: - - name: Checkout Code - uses: actions/checkout@v4 - - - name: Install Vercel CLI - run: npm install -g vercel - - - name: Deploy to Vercel - env: - VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} # Vercel token for authentication - VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} # Your Vercel project ID - VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} # Your Vercel organization ID (if applicable) - run: vercel --prod --yes - + # Checkout the repository code + - uses: actions/checkout@v2 + + # Install the latest version of Vercel CLI + - name: Install Vercel CLI + run: npm install --global vercel@latest + + # Pull Vercel environment information for production + - name: Pull Vercel Environment Information + run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} + + # Build the project + - name: Build Project Artifacts + run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} + + # Deploy the project using the prebuilt artifacts + - name: Deploy Project Artifacts to Vercel + run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}