.gitlab-ci.yml 1.26 KB
Newer Older
1
2
3
4
5
6
7
image: ruby:2.6.4

stages:
  - build
  - deploy
  - after_deploy

8
9
10
11
12
13
14
15
16
17
18
19
.artifacts_extension:
  artifacts:
    paths:
      - public
      - team.yml
    expire_in: 1d

.only_extension:
  only:
    refs:
      - gitlab_ci_setup_production

20
21
22
before_script:
  - gem install bundler jekyll --no-document

23
24
25
run_jekyll_latest_dependencies:
  stage: build
  script:
26
    - bundle update --jobs $(nproc)  "${FLAGS[@]}"
27
28
29
    - bundle exec jekyll build -d public
  allow_failure: true

30
31
32
33
run_jekyll_production:
  stage: build
  script: 
    - cp _data/team.yml team.yml
34
    - bundle install --jobs $(nproc)  "${FLAGS[@]}"
35
    - bundle exec jekyll build -d public
36
37
38
  extends:
    - .artifacts_extension
    - .only_extension
39
40
41
42
43

pages:
  stage: deploy
  script:
    - echo "deploy"
44
45
46
  extends:
    - .artifacts_extension
    - .only_extension
47
48
49
50
51
52
53
  dependencies:
    - run_jekyll_production

team_map:
  stage: after_deploy
  script: 
    - "HEADERS=\'{\"token\":\"'\"${TOKEN_TRIGGER_GITLAB_CI_SETUP}\"'\", \"ref\":\"gitlab_ci_setup_production\"}\'; curl -X POST -H \"Private-Token: ${MY_PERSONAL_ACCESS_TOKEN_API}\" -H \"Content-Type: application/json\" -d \"$HEADERS\" https://gitlab.hzdr.de/api/v4/projects/960/trigger/pipeline"
54
55
56
  extends:
    - .artifacts_extension
    - .only_extension
57
58
59
  dependencies:
    - pages