.gitlab-ci.yml 808 Bytes
Newer Older
Christophe Trefois's avatar
Christophe Trefois committed
1
2
3
4
5
image: ruby:2.5

variables:
  JEKYLL_ENV: production

6
7
8
9
10
stages:
  - test
  - deploy
  - release

Christophe Trefois's avatar
Christophe Trefois committed
11
12
13
before_script:
  - bundle install

Jacek Lebioda's avatar
Jacek Lebioda committed
14
# This will test whether the webpage builds
Christophe Trefois's avatar
Christophe Trefois committed
15
16
17
18
19
20
21
22
23
24
test:
  stage: test
  script:
  - bundle exec jekyll build -d test
  artifacts:
    paths:
    - test
  except:
  - master

Jacek Lebioda's avatar
Jacek Lebioda committed
25
# This will actually deploy the webpage when pushing to master
Christophe Trefois's avatar
Christophe Trefois committed
26
27
28
29
30
31
32
33
pages:
  stage: deploy
  script:
  - bundle exec jekyll build -d public
  artifacts:
    paths:
    - public
  only:
Jacek Lebioda's avatar
Updates    
Jacek Lebioda committed
34
  - master
Christophe Trefois's avatar
Christophe Trefois committed
35

Jacek Lebioda's avatar
Jacek Lebioda committed
36
# This will push the gem to ruby-gems when tagged
37
38
39
release:
  stage: release
  script:
40
41
    - mkdir -p ~/.gem && echo "$API_KEY_BASE64" | base64 --decode > ~/.gem/credentials && chmod 0600 ~/.gem/credentials
    - gem build jekyll-theme-lcsb-default.gemspec && gem push jekyll-theme-lcsb-default*.gem
42
43
  only:
    - tags