.gitlab-ci-mkdocs.yml 1.07 KB
Newer Older
Lukas Wiest's avatar
Lukas Wiest committed
1

2
3
4
5
6
7
8
9
variables:
  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"

cache:
  paths:
    - .cache/pip
    - venv/

Lukas Wiest's avatar
Lukas Wiest committed
10
11
12
13
14
mkdocs:compile:
  stage: compile
  image: python:3.8
  tags:
    - docker
15
16
17
18
  before_script:
    - pip install virtualenv
    - virtualenv venv
    - source venv/bin/activate
Lukas Wiest's avatar
Lukas Wiest committed
19
20
21
22
23
24
25
  script:
    - pip install -r requirements.txt -U
    - mkdocs build --strict
  only:
    changes:
      - docs/**/*
      - mkdocs.yml
26
27
      - CHANGELOG.md
      - LICENSE.md
Lukas Wiest's avatar
Lukas Wiest committed
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
  artifacts:
    expire_in: 3h
    paths:
      - site/

mkdocs:bundle:
  stage: deploy
  image: alpine
  tags:
    - docker
  script:
    - tar c -zvf documentation.tar.gz site
  needs:
    - mkdocs:compile
  only:
    changes:
      - docs/**/*
      - mkdocs.yml
46
47
      - CHANGELOG.md
      - LICENSE.md
Lukas Wiest's avatar
Lukas Wiest committed
48
49
50
51
52
  artifacts:
    expire_in: 3 days
    paths:
      - ./*.tar.gz

53
pages:
Lukas Wiest's avatar
Lukas Wiest committed
54
55
  stage: deploy
  tags:
56
    - docker
Lukas Wiest's avatar
Lukas Wiest committed
57
  script:
58
    - mv site public/
Lukas Wiest's avatar
Lukas Wiest committed
59
60
61
62
  needs:
    - mkdocs:compile
  only:
    refs:
63
      - master
Lukas Wiest's avatar
Lukas Wiest committed
64
65
66
    changes:
      - docs/**/*
      - mkdocs.yml
67
68
      - CHANGELOG.md
      - LICENSE.md
69
70
71
  artifacts:
    paths:
      - public