Skip to content

try fix missing config #22

try fix missing config

try fix missing config #22

name: Reusable Vercel Deploy (Docs)

Check failure on line 1 in .github/workflows/deploy-docs-vercel.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/deploy-docs-vercel.yml

Invalid workflow file

(Line: 93, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.VERCEL_ALIAS != ''
on:
workflow_call:
inputs:
VERCEL_ENVIRONMENT:
type: string
required: true
description: "production or preview"
DOCS_DIR:
type: string
required: true
default: "documentation"
description: "Path to docs app root"
secrets:
VERCEL_TOKEN:
required: true
VERCEL_ORG_ID:
required: true
VERCEL_PROJECT_ID:
required: true
VERCEL_SCOPE:
required: true
VERCEL_ALIAS:
required: false
env:
DOCS_DIR: ${{ inputs.DOCS_DIR }}
concurrency:
group: docs-${{ github.workflow }}-${{ github.ref }}-${{ inputs.DOCS_DIR }}
cancel-in-progress: ${{ inputs.VERCEL_ENVIRONMENT != 'production' }}
jobs:
vercel-deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
pull-requests: write
issues: write
steps:
- uses: actions/checkout@v4
# ✅ Install PNPM FIRST so setup-node's cache: pnpm can find it
- uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: ${{ env.DOCS_DIR }}/pnpm-lock.yaml
# (optional) corepack not needed now, pnpm is installed above
# - name: Enable corepack (optional)
# run: corepack enable
# Link project & pull env to {DOCS_DIR}/.vercel
- name: Vercel pull
working-directory: ${{ env.DOCS_DIR }}
run: npx --yes vercel@latest pull --yes --environment="${{ inputs.VERCEL_ENVIRONMENT }}" --token="${{ secrets.VERCEL_TOKEN }}"
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
- name: Install deps
working-directory: ${{ env.DOCS_DIR }}
run: pnpm install --frozen-lockfile
# Remote build deploy (keeps you away from routes-manifest issues)
- name: Deploy (preview)
if: ${{ inputs.VERCEL_ENVIRONMENT == 'preview' }}
working-directory: ${{ env.DOCS_DIR }}
run: npx --yes vercel@latest deploy --confirm --token="${{ secrets.VERCEL_TOKEN }}" --scope="${{ secrets.VERCEL_SCOPE }}"
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
- name: Deploy (production)
if: ${{ inputs.VERCEL_ENVIRONMENT == 'production' }}
working-directory: ${{ env.DOCS_DIR }}
run: npx --yes vercel@latest deploy --prod --confirm --token="${{ secrets.VERCEL_TOKEN }}" --scope="${{ secrets.VERCEL_SCOPE }}"
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
# Optional aliasing
- name: Alias
if: ${{ secrets.VERCEL_ALIAS != '' }}
working-directory: ${{ env.DOCS_DIR }}
run: npx --yes vercel@latest alias set "${{ secrets.VERCEL_ALIAS }}" --token="${{ secrets.VERCEL_TOKEN }}" --scope="${{ secrets.VERCEL_SCOPE }}"