-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (46 loc) · 1.39 KB
/
github-docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Docs pipeline
run-name: Docs
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
branches: [main]
env:
PROJECT_NAME: ${{ github.event.repository.name }}
PROJECT_DOCS_DIR: docs/
PROJECT_DOCS_CONFIG: mkdocs.yml
DOCKER_SERVICE: dev
DOCKER_TARGET: docs
jobs:
Build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build docker image
run: >
docker build .
--file dockers/${{env.DOCKER_SERVICE}}/dockerfile
--target ${{ env.DOCKER_TARGET }}
--tag ${{env.PROJECT_NAME}}-${{env.DOCKER_SERVICE}}:${{ env.DOCKER_TARGET }}
- uses: actions/cache@v3
with:
key: ${{ github.ref }}
path: .cache
-
name: Deploy docs
run: >
docker run -v $GITHUB_WORKSPACE:/mnt/workspace
--rm ${{env.PROJECT_NAME}}-${{env.DOCKER_SERVICE}}:${{ env.DOCKER_TARGET }}
"cd /mnt/workspace &&
git config --global --add safe.directory /mnt/workspace &&
git remote set-url origin https://${{ secrets.GITHUB_TOKEN }}@github.com/povanberg/python-poetry-template.git &&
poetry install --with docs &&
poetry run mkdocs gh-deploy --force --clean --verbose"