Files
tkmind_go/.github/workflows/pr-website-preview.yml
T
Salman Chishti 57fbffa7ad Upgrade GitHub Actions to latest versions (#6700)
Signed-off-by: Salman Muin Kayser Chishti <13schishti@gmail.com>
2026-01-26 14:39:26 -08:00

65 lines
1.8 KiB
YAML

name: Documentation Site Preview
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
paths:
- 'documentation/**'
concurrency:
group: pr-preview
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout the branch
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- name: Setup Node.js
if: github.event.action != 'closed'
uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3
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: Deploy preview
uses: rossjrw/pr-preview-action@ffa7509e91a3ec8dfc2e5536c4d5c1acdf7a6de9 # v1.8.1
if: ${{ github.event.pull_request.head.repo.full_name == 'block/goose' }}
with:
source-dir: documentation/build
cleanup:
runs-on: ubuntu-latest
needs: deploy
if: github.event.action == 'closed'
permissions:
contents: write
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
- name: Clean up gh-pages branch
run: |
bash scripts/clean-gh-pages.sh
git push origin $(git rev-parse origin/gh-pages):gh-pages --force