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
47 changes: 47 additions & 0 deletions .github/workflows/dev-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- master
workflow_dispatch:

env:
CI_DOCKER_CACHE_PATH: ci/cache/docker

# Мы хотим чтобы deploy в ветку gh-pages
# происходили консистентно друг за другом
concurrency:
Expand All @@ -19,25 +22,69 @@ jobs:
deploy:
name: Deploy dev documentation
runs-on: ubuntu-22.04
env:
RENDERER_NETWORK: renderer-net
RENDERER_IMAGE: plantuml/plantuml-server:jetty-v1.2026.0
RENDERER_CONTAINER_NAME: renderer
defaults:
run:
working-directory: documentation
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Setup docker image cache
id: docker-image-cache
uses: actions/cache@v3
with:
path: ${{ env.CI_DOCKER_CACHE_PATH }}
key: ${{ env.RENDERER_IMAGE }}

- name: Update docker image cache
if: steps.docker-image-cache.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}
run: |
docker pull "$RENDERER_IMAGE"
mkdir -p ${CI_DOCKER_CACHE_PATH}/${RENDERER_IMAGE}
docker image save -o ${CI_DOCKER_CACHE_PATH}/${RENDERER_CONTAINER_NAME}.tar "$RENDERER_IMAGE"

- name: Load docker image cache
if: steps.docker-image-cache.outputs.cache-hit == 'true'
working-directory: ${{ github.workspace }}
run: |
docker image load -i ${CI_DOCKER_CACHE_PATH}/${RENDERER_CONTAINER_NAME}.tar

- name: Start renderer service locally
run: |
docker network create "$RENDERER_NETWORK"
docker run -d -p 7036:8080 --name "$RENDERER_CONTAINER_NAME" --network "$RENDERER_NETWORK" "$RENDERER_IMAGE"


- name: Configure Git user
run: |
git config user.email "actions@github.com"
git config user.name "GitHub Actions"


- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.x
cache: 'pip'

- name: Download mkdocs plugins
run: pip install -r requirements.txt

- name: Deploy documentation into gh-pages branch
run: mike deploy dev --push

- name: Setup default version
run: mike set-default dev --push

- name: Cleanup renderer container
if: always()
run: |
docker rm -f "$RENDERER_CONTAINER_NAME"
docker network rm -f "$RENDERER_NETWORK"
docker rmi -f ${RENDERER_REGISTRY}${RENDERER_IMAGE}
41 changes: 41 additions & 0 deletions .github/workflows/release-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
required: true
type: string

env:
CI_DOCKER_CACHE_PATH: ci/cache/docker

# Мы хотим чтобы deploy в ветку gh-pages
# происходили консистентно друг за другом
concurrency:
Expand All @@ -21,6 +24,10 @@ jobs:
deploy:
name: Deploy release documentation
runs-on: ubuntu-22.04
env:
RENDERER_NETWORK: renderer-net
RENDERER_IMAGE: plantuml/plantuml-server:jetty-v1.2026.0
RENDERER_CONTAINER_NAME: renderer
steps:
- name: Validate semver tag format
id: validate-tag
Expand All @@ -38,12 +45,39 @@ jobs:
echo "✅ Valid tag: $TAG"
echo "Version for docs: $VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Checkout repository with tag
uses: actions/checkout@v6
with:
ref: "${{ github.event.inputs.tag }}"
fetch-depth: 0

- name: Setup docker image cache
id: docker-image-cache
uses: actions/cache@v3
with:
path: ${{ env.CI_DOCKER_CACHE_PATH }}
key: ${{ env.RENDERER_IMAGE }}

- name: Update docker image cache
if: steps.docker-image-cache.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}
run: |
docker pull "$RENDERER_IMAGE"
mkdir -p ${CI_DOCKER_CACHE_PATH}/${RENDERER_IMAGE}
docker image save -o ${CI_DOCKER_CACHE_PATH}/${RENDERER_CONTAINER_NAME}.tar "$RENDERER_IMAGE"

- name: Load docker image cache
if: steps.docker-image-cache.outputs.cache-hit == 'true'
working-directory: ${{ github.workspace }}
run: |
docker image load -i ${CI_DOCKER_CACHE_PATH}/${RENDERER_CONTAINER_NAME}.tar

- name: Start renderer service locally
run: |
docker network create "$RENDERER_NETWORK"
docker run -d -p 7036:8080 --name "$RENDERER_CONTAINER_NAME" --network "$RENDERER_NETWORK" ${RENDERER_REGISTRY}${RENDERER_IMAGE}

- name: Configure Git user
run: |
git config user.email "actions@github.com"
Expand All @@ -66,3 +100,10 @@ jobs:
# env:
# # Для дебага, если нужно
# MIKE_VERBOSE: 1

- name: Cleanup renderer container
if: always()
run: |
docker rm -f "$RENDERER_CONTAINER_NAME"
docker network rm -f "$RENDERER_NETWORK"
docker rmi -f ${RENDERER_REGISTRY}${RENDERER_IMAGE}
7 changes: 5 additions & 2 deletions documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
source venv/bin/activate
pip install -r requirements.txt
```

2. Соберите или запустите сайт:
2. Необходим `docker`. Запустите сервер рендеринга локально:
```shell
docker run -d -p 7036:8080 plantuml/plantuml-server:jetty-v1.2026.0
```
3. Соберите или запустите сайт:

```shell
mkdocs build
Expand Down
7 changes: 5 additions & 2 deletions documentation/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ To deploy documentation locally on current branch/tag:
source venv/bin/activate
pip install -r requirements.txt
```

2. Build or serve site:
2. Requires `docker`. Start the render server locally:
```shell
docker run -d -p 7036:8080 plantuml/plantuml-server:jetty-v1.2026.0
```
3. Build or serve site:

```shell
mkdocs build
Expand Down
2 changes: 1 addition & 1 deletion documentation/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ plugins:
- drawio:
darkmode: true
- plantuml:
puml_url: https://www.plantuml.com/plantuml/
puml_url: http://localhost:7036
# в секундах(in seconds)
request_timeout: 300

Expand Down