Skip to content

Documentation 📚

Documentation 📚 #1

Workflow file for this run

# This workflow is based on https://github.com/vitejs/vite/tree/main/.github/workflows
name: Documentation 📚
on:
push:
branches:
- main
paths:
- "docs/**"
pull_request:
types: [opened, synchronize, reopened]
paths:
- "docs/**"
workflow_dispatch:
jobs:
deploy:
name: Deploy 🚀
if: github.repository == 'lazarv/react-server-testing'
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Install deps
run: pnpm install
- name: Install Vercel CLI
run: npm install -g vercel@latest
- name: Pull Vercel Environment Information
working-directory: ./docs
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build docs
run: pnpm run docs:build
- name: Deploy Project Artifacts to Vercel
if: ${{ github.event_name == 'pull_request' }}
working-directory: ./docs
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
run: |
url=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})
echo "VERCEL_URL=${url}" >> $GITHUB_ENV
- uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
header: pr-docs-preview-url
message: |
✅ Documentation preview deployed to: ${{ env.VERCEL_URL }}
- name: Deploy Project Artifacts to Vercel Production Environment
if: ${{ github.ref == 'refs/heads/main' }}
working-directory: ./docs
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}