.gitlab-ci-mkdocs.yml 870 Bytes
Newer Older
Lukas Wiest's avatar
Lukas Wiest committed
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

mkdocs:compile:
  stage: compile
  image: python:3.8
  tags:
    - docker
  script:
    - pip install -r requirements.txt -U
    - mkdocs build --strict
  only:
    changes:
      - docs/**/*
      - mkdocs.yml
  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
  artifacts:
    expire_in: 3 days
    paths:
      - ./*.tar.gz

mkdocs:deploy:
  stage: deploy
  tags:
    - production
  variables:
    EXPORT_DIR: "/var/www/html/pages"
  script:
    - mkdir -p "$EXPORT_DIR/$CI_PROJECT_NAME"
    - cp -r site/* "$EXPORT_DIR/$CI_PROJECT_NAME"
  needs:
    - mkdocs:compile
  only:
    refs:
50
      - master
Lukas Wiest's avatar
Lukas Wiest committed
51
52
53
    changes:
      - docs/**/*
      - mkdocs.yml