diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index f4a8e7cb89..c7229190e7 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -26,16 +26,12 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: commaai/timeout@v1 - - uses: actions/checkout@v7 - with: - submodules: true + - run: ./tools/op.sh setup # Build - name: Build docs - run: | - git lfs pull - python docs/serve.py --build + run: ./tools/op.sh docs --build # Push to docs.comma.ai - uses: actions/checkout@v7 diff --git a/docs/README.md b/docs/README.md index d6a0126b39..dc6eee6905 100644 --- a/docs/README.md +++ b/docs/README.md @@ -5,10 +5,10 @@ The site is updated on pushes to master by this [workflow](../.github/workflows/ **1. Build the site** ``` bash -python docs/serve.py --build +op docs --build ``` **2. Run the site locally** (rebuilds on change) ``` bash -python docs/serve.py +op docs ``` diff --git a/tools/op.sh b/tools/op.sh index 3d7d17a76b..43c88a2a86 100755 --- a/tools/op.sh +++ b/tools/op.sh @@ -349,6 +349,11 @@ function op_clip() { op_run_command openpilot/tools/clip/run.py "$@" } +function op_docs() { + op_before_cmd + op_run_command python docs/serve.py "$@" +} + function op_check_agnos_update() { if [[ ! -f "/AGNOS" ]]; then return 0 @@ -447,6 +452,7 @@ function op_default() { echo -e " ${BOLD}replay${NC} Run Replay" echo -e " ${BOLD}cabana${NC} Run Cabana" echo -e " ${BOLD}clip${NC} Run clip (linux only)" + echo -e " ${BOLD}docs${NC} Build or serve the openpilot documentation" echo -e " ${BOLD}adb${NC} Run adb shell" echo -e " ${BOLD}ssh${NC} comma prime SSH helper" echo "" @@ -502,6 +508,7 @@ function _op() { test ) shift 1; op_test "$@" ;; replay ) shift 1; op_replay "$@" ;; clip ) shift 1; op_clip "$@" ;; + docs ) shift 1; op_docs "$@" ;; sim ) shift 1; op_sim "$@" ;; switch ) shift 1; op_switch "$@" ;; start ) shift 1; op_start "$@" ;;