fix: handling http response headers (#106) #71
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: | |
permissions: | |
pull-requests: write | |
jobs: | |
deploy: | |
name: Deploy 🚀 | |
if: github.repository == 'lazarv/react-server' | |
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 }} |