forked from devops117/kupferbootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
60 lines (54 loc) · 1.23 KB
/
.gitlab-ci.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
52
53
54
55
56
57
58
59
60
stages:
- check
- build
- deploy
format:
stage: check
image: python
before_script:
- pip install yapf autoflake
script:
- ./format.sh --check
typecheck:
stage: check
image: python
before_script:
- pip install mypy
script:
- ./typecheck.sh --non-interactive --junit-xml mypy-report.xml
artifacts:
reports:
junit: mypy-report.xml
build_docker:
stage: build
image: docker:latest
services: ['docker:dind']
before_script:
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
script:
- docker build --pull -t "${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA}" -t "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}" .
- if [[ "$CI_COMMIT_REF_NAME" == "main" ]]; then docker image tag "${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA}" "${CI_REGISTRY_IMAGE}:latest"; fi
- docker push -a "${CI_REGISTRY_IMAGE}"
only:
- main
- dev
.docs:
image: "${CI_REGISTRY_IMAGE}:dev"
before_script:
- pip install -r docs/requirements.txt
script:
- (cd docs && make)
- mv docs/html public
artifacts:
paths:
- public
build_docs:
stage: build
extends: .docs
except:
- main
pages:
stage: deploy
extends: .docs
only:
- main