name: Documentation Site Preview on: pull_request: types: - opened - reopened - synchronize - closed paths: - 'documentation/**' push: branches-ignore: - 'dependabot/**' concurrency: pr-preview 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@8ff09e486b4c23709012eedd3b42e9f0b95dd0c5 # v1 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@38f3f104447c67c051c4a08e39b64a148898af3a # v4 - 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