vercel / vercel/examples

Customizing the build step for ci-cd/github-actions

Open
#616 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5.2k
Forks
1.8k
Avg merge
3d 12h
Merged PRs (30d)
6

Description

I am setting up a deployment of a Docusaurus site to Vercel, but I do not want to use your automated build. I would like to use my own GitHub action steps to build, as I need to grab some external files from another GitHub repo, and then upload the generated site.

I am seeing the error "Config file was not found at "/vercel/path0/.vercel/output/config.json"

Run vercel deploy --prebuilt --token=***
  
Vercel CLI 28.18.2
Retrieving project…
Deploying danroscigno/docpreview
Uploading [====================] (956.0KB/956KB)
Inspect: https://vercel.com/danroscigno/docpreview/2n9PhpWYP6ZEV95tm5ugLfwCVMeC [4s]
Queued
Building
Error: Config file was not found at "/vercel/path0/.vercel/output/config.json"
https://docpreview-j7w7p310z-danroscigno.vercel.app/
Error: Process completed with exit code 1.

Here is my workflow file:

name: GitHub Actions Vercel Preview Deployment
env:
  VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
  VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
  push:
    branches-ignore:
      - main
jobs:
  Deploy-Preview:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install Vercel CLI
        run: npm install --global vercel@canary
      - name: Pull Vercel Environment Information
        run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
      - name: Download Reference Doc
        run:  |
          curl https://codeload.github.com/ClickHouse/ClickHouse/tar.gz/master | tar -xz -C ./ --strip=2 "ClickHouse-master/docs/"
          cp ./en/sql-reference/syntax.md docs/
      - name: Set up Node
        uses: actions/setup-node@v3
        with:
          node-version: 18
      # Install and build Docusaurus website
      - name: Build Docusaurus website
        run: |
          export NODE_OPTIONS="--max_old_space_size=4096"
          npm install -g yarn
          yarn install
          yarn build --out-dir .vercel/output
      - name: Deploy Project Artifacts to Vercel
        run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}

Thanks so much!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the workflow shown in the issue, especially the Docusaurus build and vercel deploy --prebuilt steps, and inspect the generated .vercel/output contents. Compare those artifacts with the error requiring .vercel/output/config.json; done means the custom GitHub Actions build produces the expected deployment artifacts and the Vercel preview deployment completes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, node.js
Domain
ci-cd, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.