.gitlab-ci.yml 911 Bytes
Newer Older
Alex Ives's avatar
Alex Ives committed
1
.defaults: &defaults
Alex Ives's avatar
Alex Ives committed
2
  image: registry.gitlab.com/alexives/alexives.gitlab.io:latest
Alex Ives's avatar
Alex Ives committed
3
4
5
6
  variables:
    JEKYLL_ENV: production
  before_script:
    - bundle install
Alex Ives's avatar
Alex Ives committed
7

8
9
10
11
stages:
  - test
  - deploy

Alex Ives's avatar
Alex Ives committed
12
test:
Alex Ives's avatar
Alex Ives committed
13
  <<: *defaults
Alex Ives's avatar
Alex Ives committed
14
15
  stage: test
  script:
16
    - bundle exec rake test
Alex Ives's avatar
Alex Ives committed
17
18
  artifacts:
    paths:
19
      - test
Alex Ives's avatar
Alex Ives committed
20

Alex Ives's avatar
Alex Ives committed
21
build:docker:
Alex Ives's avatar
Alex Ives committed
22
23
24
25
26
  only:
    changes:
      - Dockerfile
      - Gemfile
      - Gemfile.lock
27
28
29
30
31
32
33
34
  image: docker:stable
  services:
    - docker:dind
  stage: deploy
  script:
    - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
    - docker build -t registry.gitlab.com/alexives/alexives.gitlab.io:latest .
    - docker push registry.gitlab.com/alexives/alexives.gitlab.io:latest
Alex Ives's avatar
Alex Ives committed
35

Alex Ives's avatar
Alex Ives committed
36
pages:
Alex Ives's avatar
Alex Ives committed
37
  <<: *defaults
Alex Ives's avatar
Alex Ives committed
38
39
  stage: deploy
  script:
40
    - bundle exec rake build
Alex Ives's avatar
Alex Ives committed
41
42
  artifacts:
    paths:
Alex Ives's avatar
Alex Ives committed
43
    - public
Alex Ives's avatar
Alex Ives committed
44
  only:
45
46
47
48
    - master
  environment:
    name: production
    url: https://alexives.gitlab.io