for test #74
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: dev-documentation | |
| on: | |
| push: | |
| branches: | |
| - refactor-pluntuml-renderer | |
| workflow_dispatch: | |
| # Мы хотим чтобы deploy в ветку gh-pages | |
| # происходили консистентно друг за другом | |
| concurrency: | |
| group: deploy-docs | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| 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 | |
| RENDERER_IMAGE_CACHE_PATH: ci/cache/docker | |
| defaults: | |
| run: | |
| working-directory: documentation | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Restore renderer image if it exists | |
| id: cache-docker-plantuml-server | |
| uses: actions/cache@v3 | |
| with: | |
| path: ${{ env.RENDERER_IMAGE_CACHE_PATH }} | |
| key: ${{ env.RENDERER_IMAGE }} | |
| - name: Update renderer image cache if cache miss | |
| if: steps.cache-docker-plantuml-server.outputs.cache-hit != 'true' | |
| run: | | |
| docker pull "$RENDERER_IMAGE" | |
| mkdir -p ${RENDERER_IMAGE_CACHE_PATH}/${RENDERER_IMAGE} | |
| docker image save -o ${RENDERER_IMAGE_CACHE_PATH}/image.tar "$RENDERER_IMAGE" | |
| - name: Use renderer image cache if cache hit | |
| if: steps.cache-docker-plantuml-server.outputs.cache-hit == 'true' | |
| run: | | |
| docker image load -i ${RENDERER_IMAGE_CACHE_PATH}/${RENDERER_IMAGE}.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} |