Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ on:
pull_request:

env:
MKDOCS_MATERIAL_VER: 9.6.16-insiders-4.53.16-hellt
MKDOCS_MATERIAL_IMAGE: ghcr.io/eda-labs/mkdocs-material:v9.7.1-1

jobs:
docs-test:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

Expand All @@ -24,7 +24,7 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- run: docker run -v $(pwd):/docs --entrypoint mkdocs ghcr.io/srl-labs/mkdocs-material-insiders:$MKDOCS_MATERIAL_VER build --clean --strict
- run: docker run -v $(pwd):/docs --entrypoint mkdocs ${MKDOCS_MATERIAL_IMAGE} build --clean --strict

- name: Cache htmltest external links
id: cache-htmltest
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
# - run: docker run -v $(pwd):/docs --entrypoint ash ghcr.io/srl-labs/mkdocs-material-insiders:$MKDOCS_MATERIAL_VER -c 'git config --global --add safe.directory /docs; mkdocs gh-deploy --force'

publish-docs:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
steps:
Expand All @@ -89,7 +89,7 @@ jobs:

- name: Build docs
run: |
docker run --env CI=true --env MKDOCS_GIT_COMMITTERS_APIKEY=${{ secrets.GITHUB_TOKEN }} -v $(pwd):/docs --user $(id -u):$(id -g) --entrypoint mkdocs ghcr.io/srl-labs/mkdocs-material-insiders:$MKDOCS_MATERIAL_VER build
docker run --env CI=true --env MKDOCS_GIT_COMMITTERS_APIKEY=${{ secrets.GITHUB_TOKEN }} -v $(pwd):/docs --user $(id -u):$(id -g) --entrypoint mkdocs ${MKDOCS_MATERIAL_IMAGE} build

- name: Publish to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
Expand Down
36 changes: 13 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,43 +1,33 @@
MKDOCS_VER = 9.6.1
# insiders version/tag https://github.com/srl-labs/mkdocs-material-insiders/pkgs/container/mkdocs-material-insiders
# when changing the version, update the version in the cicd.yml file
MKDOCS_INS_VER = 9.6.16-insiders-4.53.16-hellt
MKDOCS_VERSION ?= v9.7.1-1
MKDOCS_INET_IMAGE := ghcr.io/eda-labs/mkdocs-material:$(MKDOCS_VERSION)

.PHONY: docs
docs:
docker run --rm -v $$(pwd):/docs --entrypoint mkdocs registry.srlinux.dev/pub/mkdocs-material-insiders:$(MKDOCS_INS_VER) build --clean --strict
docker run --rm -v $$(pwd):/docs --entrypoint mkdocs ${MKDOCS_INET_IMAGE} build --clean --strict

# serve the site locally using mkdocs-material public container
.PHONY: serve
serve:
docker run -it --rm -p 8001:8000 -v $$(pwd):/docs squidfunk/mkdocs-material:$(MKDOCS_VER)

# serve the site locally using mkdocs-material insiders container
.PHONY: serve-insiders
serve-insiders:
# serve the doc site locally with full site rendered on each change (slower)
.PHONY: serve-docs-full
Comment thread
hellt marked this conversation as resolved.
serve-docs-full:
docker run -it --rm -p 8001:8000 -v $$(pwd):/docs registry.srlinux.dev/pub/mkdocs-material-insiders:$(MKDOCS_INS_VER)
Comment thread
hellt marked this conversation as resolved.

# serve the site locally using mkdocs-material insiders container using dirty-reloader
.PHONY: serve-insiders-dirty
serve-insiders-dirty:
docker run -it --rm -p 8001:8000 -v $$(pwd):/docs registry.srlinux.dev/pub/mkdocs-material-insiders:$(MKDOCS_INS_VER) serve --dirtyreload -a 0.0.0.0:8000

# serve the doc site locally with dirty reload (faster, but toc updates may require a manual stop/start)
.PHONY: serve-docs
serve-docs: serve-insiders-dirty
serve-docs:
docker run -it --rm -p 8001:8000 -v $$(pwd):/docs ${MKDOCS_INET_IMAGE} serve --dirtyreload -a 0.0.0.0:8000

.PHONY: htmltest
htmltest:
docker run --rm -v $$(pwd):/docs --entrypoint mkdocs registry.srlinux.dev/pub/mkdocs-material-insiders:$(MKDOCS_INS_VER) build --clean --strict
docker run --rm -v $$(pwd):/docs --entrypoint mkdocs ${MKDOCS_INET_IMAGE} build --clean --strict
docker run --rm -v $$(pwd):/test wjdp/htmltest --conf ./site/htmltest.yml
rm -rf ./site

build-insiders:
docker run -v $$(pwd):/docs --entrypoint mkdocs registry.srlinux.dev/pub/mkdocs-material-insiders:$(MKDOCS_INS_VER) build --clean --strict
docker run -v $$(pwd):/docs --entrypoint mkdocs ${MKDOCS_INET_IMAGE} build --clean --strict

push-docs: # push docs to gh-pages branch manually. Use when pipeline misbehaves
docker run -v ${SSH_AUTH_SOCK}:/ssh-agent --env SSH_AUTH_SOCK=/ssh-agent --env GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" -v $$(pwd):/docs --entrypoint mkdocs ghcr.io/srl-labs/mkdocs-material-insiders:$(MKDOCS_INS_VER) gh-deploy --force --strict
docker run -v ${SSH_AUTH_SOCK}:/ssh-agent --env SSH_AUTH_SOCK=/ssh-agent --env GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" -v $$(pwd):/docs --entrypoint mkdocs ${MKDOCS_INET_IMAGE} gh-deploy --force --strict
Comment thread
hellt marked this conversation as resolved.
Comment thread
hellt marked this conversation as resolved.

add-no-index: # replace noindex commen in main template to include robots noindex instruction. This is needed prior pushing to staging, so that staging is not indexed by robots
add-no-index: # replace noindex comment in main template to include robots noindex instruction. This is needed prior pushing to staging, so that staging is not indexed by robots
sed -i 's/<!-- NOINDEX -->/<meta name="robots" content="noindex">/g' docs/overrides/main.html

# build html docs and push to staging1 server - https://hellt.github.io/learn-srlinux-stage1
Expand Down
Loading