mirror of https://github.com/knative/docs.git
add gh-action to deploy mkdocs to gh-pages (#3557)
* add gh-action to deploy mkdocs to gh-pages * update commit user for gh-pages Signed-off-by: Carlos Santana <csantana23@gmail.com> * switch to fast livereload Signed-off-by: Carlos Santana <csantana23@gmail.com>
This commit is contained in:
parent
d6e12b982d
commit
5e9b4024ff
|
@ -0,0 +1,31 @@
|
|||
name: Publish MkDocs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ mkdocs ]
|
||||
|
||||
jobs:
|
||||
mkdocs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: "3.9"
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install mkdocs mkdocs-macros-plugin mkdocs-exclude mike
|
||||
|
||||
- name: Setup doc deploy
|
||||
run: |
|
||||
git config --global user.name "Knative Automation"
|
||||
git config --global user.email automation@knative.team
|
||||
|
||||
- name: Build docs
|
||||
run: |
|
||||
mike deploy dev --push
|
|
@ -0,0 +1,2 @@
|
|||
FROM squidfunk/mkdocs-material
|
||||
RUN pip install --no-cache-dir mkdocs-macros-plugin mkdocs-exclude mike
|
|
@ -0,0 +1,19 @@
|
|||
# Development notes for working with mkdocs
|
||||
|
||||
## Container
|
||||
|
||||
Build the container image
|
||||
```bash
|
||||
./hack/docker/build.sh
|
||||
```
|
||||
|
||||
Run the livereload site
|
||||
```bash
|
||||
./hack/docker/run.sh
|
||||
```
|
||||
|
||||
Remove the container
|
||||
```bash
|
||||
./hack/docker/clean.sh
|
||||
```
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
IMAGE=${1:-mkdocs}
|
||||
|
||||
SCRIPT_DIR=$(cd $(dirname $0); pwd -P)
|
||||
ROOT_DIR=$(cd "${SCRIPT_DIR}/.."; pwd -P)
|
||||
|
||||
docker build -t ${IMAGE} ${SCRIPT_DIR}
|
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
NAME=${1:-mkdocs}
|
||||
|
||||
echo "Cleaning up old container '${NAME}'..."
|
||||
docker rm "${NAME}" --force 1> /dev/null 2> /dev/null
|
||||
|
||||
echo "Finished clean up"
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
PORT=${2:-8000}
|
||||
|
||||
mkdocs serve --config-file "./mkdocs.yml" --livereload -a 0.0.0.0:${PORT}
|
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
NAME=${1:-mkdocs}
|
||||
PORT=${2:-8000}
|
||||
IMAGE=${3:-mkdocs}
|
||||
|
||||
docker run --name "${NAME}" -d -p "${PORT}:${PORT}" -v "${PWD}:/site" mkdocs serve -f /site/mkdocs.yml --dirtyreload -a "0.0.0.0:${PORT}"
|
||||
echo "Dev environment running with live reloading enabled. Open http://localhost:${PORT} to see the site"
|
||||
echo "For live logs run:"
|
||||
echo "docker logs -f ${NAME}"
|
Loading…
Reference in New Issue