Skip to content

[Docs] CLI Documentation #21

[Docs] CLI Documentation

[Docs] CLI Documentation #21

name: Build PR Docs Preview
# Splitting the preview docs build into an (untrusted) build step (this one)
# and a trusted deployment step helps prevent a class of issues that allow
# secret exfiltration from a repo.
# See https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
permissions:
contents: read
# When a new udpate is made to this PR, cancel any still-running builds from previous pushes
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
paths:
- 'docs/**'
- 'spy/cli/**' # Rebuild cli docs when cli changes
- '.github/workflows/docs**'
types:
- opened
- synchronize
- reopened
workflow_dispatch:
jobs:
build-preview:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Install dependencies
run: |
pip install .[docs]
- name: Build and mkdocs
run: |
mkdocs build --config-file docs/mkdocs.yml --site-dir ./site -v
- name: Upload preview artifact
uses: actions/upload-artifact@v4
with:
name: pr-preview-docs-${{ github.event.number }}
path: docs/site
if-no-files-found: error
retention-days: 7