NextJS CI/CD with GitHub actions unexpected error

Viewed 11

Was trying to configure ci/cd with nextjs, deploy_development jobs is failing & throwing error like Error: The deployment https://rubrica-qlicv5ca9-manikangkandas.vercel.app is not ready. Error: The process '/opt/hostedtoolcache/node/14.20.0/x64/bin/npx' failed with exit code 1

This is just an initial boilerplate from nextjs, no code has been added so far except for workflow and vercel.json. Any kind of help would be greatly appreciated.

deploy.yml

name: Deploy to Vercel

on:
  workflow_dispatch:
    inputs:
      deploy_production:
        description: "Deploy Production"
        required: true
        type: boolean
        # default: false
  push:
    branches:
    tags:
  pull_request:

jobs:
  # --- check lint ---------------
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v3
        with:
          node-version: 14
      - name: Installing depedencies
        run: yarn install
      - name: Running test lint
        run: yarn lint
  # --- build ---------------
  build:
    runs-on: ubuntu-latest
    needs: lint
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v3
        with:
          node-version: 14
      - name: Installing depedencies
        run: yarn install
      - name: Try to build
        run: yarn build
  # --- deploy development ---------------
  deploy_development:
    if: |
      github.event_name != 'pull_request' &&
      (
        github.ref_name == 'main' ||
        startsWith(github.ref, 'refs/tags/')
      )
    runs-on: ubuntu-latest
    needs: [lint, build]
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v3
        with:
          node-version: 14
      - name: Installing depedencies
        run: yarn install
      - name: Try to build
        run: yarn build
      - name: Deploy to vercel
        uses: amondnet/vercel-action@v20
        with:
          vercel-token: ${{ secrets.VERCEL_TOKEN }}
          vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
          vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
          alias-domains: github-action-next-dev.vercel.app
  # --- deploy production ---------------
  deploy_production:
    if: |
      startsWith(github.ref, 'refs/tags/') &&
      github.event.inputs.deploy_production == 'true'
    runs-on: ubuntu-latest
    needs: [lint, build, deploy_development]
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v3
        with:
          node-version: 14
      - name: Installing depedencies
        run: yarn install
      - name: Try to build
        run: yarn build
      - name: Deploy to vercel
        uses: amondnet/vercel-action@v20
        with:
          vercel-token: ${{ secrets.VERCEL_TOKEN }}
          vercel-args: "--prod"
          vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
          vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}

package.json

{
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "next": "12.2.5",
    "react": "18.2.0",
    "react-dom": "18.2.0"
  },
  "devDependencies": {
    "eslint": "8.23.0",
    "eslint-config-next": "12.2.5"
  }
}

error recieved

Run amondnet/vercel-action@v20
set environment for vercel cli
set env variable : VERCEL_ORG_ID
set env variable : VERCEL_PROJECT_ID
using scope
/opt/hostedtoolcache/node/14.20.0/x64/bin/npx vercel  -t *** -m githubCommitSha=33299fce99919dac35bcacc0055e01d07b418e72 -m githubCommitAuthorName=manikangkandas -m githubCommitAuthorLogin=manikangkandas -m githubDeployment=1 -m githubOrg=manikangkandas -m githubRepo=rubrica -m githubCommitOrg=manikangkandas -m githubCommitRepo=rubrica -m githubCommitMessage="fix: deploy development scope add" -m githubCommitRef=main --scope ***
Vercel CLI 28.2.2
..............
..............
..............
set preview-name output
alias domains to this deployment
using scope
/opt/hostedtoolcache/node/14.20.0/x64/bin/npx vercel -t *** --scope *** alias https://rubrica-qlicv5ca9-manikangkandas.vercel.app github-action-next-dev.vercel.app
Vercel CLI 28.2.2
> Assigning alias github-action-next-dev.vercel.app to deployment rubrica-qlicv5ca9-manikangkandas.vercel.app
Creating alias
Error: The deployment https://rubrica-qlicv5ca9-manikangkandas.vercel.app is not ready.
Error: The process '/opt/hostedtoolcache/node/14.20.0/x64/bin/npx' failed with exit code 1


0 Answers
Related