Skip to content

docs site: add PR previews #6

docs site: add PR previews

docs site: add PR previews #6

name: Documentation Site Preview
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
paths:
- 'documentation/**'
concurrency: preview-${{ github.ref }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout the branch
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
if: github.event.action != 'closed'
with:
node-version: 20
- name: Install dependencies and build docs
working-directory: ./documentation
if: github.event.action != 'closed'
env:
INKEEP_API_KEY: ${{ secrets.INKEEP_API_KEY }}
INKEEP_INTEGRATION_ID: ${{ secrets.INKEEP_INTEGRATION_ID }}
INKEEP_ORG_ID: ${{ secrets.INKEEP_ORG_ID }}
TARGET_PATH: "/goose/pr-preview/pr-${{ github.event.number }}/"
run: |
npm install
npm run build
- name: Install dependencies and build extensions-site
working-directory: ./extensions-site
env:
VITE_BASENAME: "/goose/pr-preview/pr-${{ github.event.number }}/v1/extensions/" # Set the base URL here for the extensions site
run: |
npm install
npm run build
- name: Combine builds into one directory
run: |
mkdir combined-build
cp -r documentation/build/* combined-build/
mkdir -p combined-build/v1/extensions
cp -r extensions-site/build/client/* combined-build/v1/extensions/
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
if: ${{ github.event.pull_request.head.repo.full_name == 'block/goose' }}
with:
source-dir: combined-build