From 3170d7cc4399a2acf3c2bf7df8f4f7f66bd22220 Mon Sep 17 00:00:00 2001 From: Kyle Somers <17753062+kylesomers@users.noreply.github.com> Date: Mon, 3 Jun 2024 10:20:18 -0500 Subject: [PATCH] ci: Update github action for docs (#39) --- .github/workflows/docs.yml | 11 ++++------- Makefile | 10 +++++++++- docs/Dockerfile | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 5d0bfac0..b7c498c9 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -7,6 +7,7 @@ on: - "docs/**" - "mkdocs.yml" - "CHANGELOG.md" + - "**/README.md" - ".github/workflows/docs.yml" workflow_dispatch: permissions: @@ -17,21 +18,17 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - - name: Install poetry - run: pipx install poetry - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.12" - - name: Install dependencies - run: make dev - name: Git client setup run: | git config user.name github-actions[bot] git config user.email 41898282+github-actions[bot]@users.noreply.github.com - - name: Build docs website and API reference - run: mike set-default --push latest + - name: Build docs + run: make docs-build - name: Deploy Docs - run: mike deploy $(git rev-parse --short HEAD) latest --push + run: make docs-deploy # - run: mkdocs gh-deploy --force diff --git a/Makefile b/Makefile index 5d9b3216..83b8a83d 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,11 @@ +docs-build: + docker build -t squidfunk/mkdocs-material ./docs/ + docs-local-docker: docker build -t squidfunk/mkdocs-material ./docs/ - docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material + docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material serve -a 0.0.0.0:8000 + +docs-deploy: + pip install -r ./docs/requirements.txt + mike set-default $(git rev-parse --short HEAD) + mike deploy --push --update-aliases \ No newline at end of file diff --git a/docs/Dockerfile b/docs/Dockerfile index f97b7617..f79192ea 100644 --- a/docs/Dockerfile +++ b/docs/Dockerfile @@ -2,4 +2,4 @@ FROM squidfunk/mkdocs-material COPY ./requirements.txt requirements.txt # Set PIP_USER to "no" to suppress warnings. Fine to run as root for local mkdocs development server. ENV PIP_USER=no -RUN pip install -r requirements.txt \ No newline at end of file +RUN pip install -r requirements.txt