Preview deployment GitHub actions

Question:
I want to include “npm run wix preview” in my github workflow .

Product:
Wix editor , github

What are you trying to achieve:
What I’m trying to achieve is to set up a GitHub workflow that automatically builds the site and provides a preview link (something like a staging or preview environment) whenever I push to a branch or open a pull request.

What have you already tried:
I have created the workflow file and experimented with various code lines , but so far I have not able to resolve the issue.

Additional information:
I get this error when “npm run wix preview” is run in the workflow.

A. this command prompts for source by default, you can do npx wix preview --source local to provide it for non-interactive environments

B. Be careful about automatic previews - as it currently stands, Preview deployments never expire!

Hi , thanks for the reply , but I am getting this error :backhand_index_pointing_down:
The image shows terminal error messages indicating unknown options, a failed command with an exit code, and a completed process with exit code 1. (Captioned by AI)

Not sure, what does Wix -v give you? Perhaps it is not up to date

I tried wix -v in terminal and got this 1.1.81

name: Vercel Preview Deployment

on : push 

env:
  VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
  VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

jobs:
  Deploy-Preview:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Install Node.js
        uses: actions/setup-node@v2
        with:
          node-version: '22' # Specify the Node.js version you need

      - name: Install Vercel CLI
        run: npm install --global vercel@latest

      - name: Pull Vercel Environment Information
        run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}

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

      - name: Deploy Project Artifacts to Vercel
        id: deploy
        run: |
          vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} --prod --confirm

      - name: Get Preview URL
        run: echo "Preview URL:"

this is my deploy-preview.yml file