diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 46f446e..2e47fcc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,6 +2,7 @@ name: Vercel Production Deployment env: VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} + on: push: branches: @@ -13,12 +14,25 @@ jobs: run: working-directory: 04-nestjs-rick-and-morty steps: - - uses: actions/checkout@v2 + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: NPM Install + run: npm install + - name: Install Vercel CLI - run: npm install --global vercel@latest + run: npm add -g vercel@latest + - name: Pull Vercel Environment Information - run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} + run: vercel pull --yes --environment=production --token=${{ env.VERCEL_TOKEN }} + - name: Build Project Artifacts - run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} + run: vercel build --prod + - name: Deploy Project Artifacts to Vercel - run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} + run: vercel deploy --prebuilt --prod --token=${{ env.VERCEL_TOKEN }}