.gitlab-ci.yml 1.07 KB
Newer Older
1
image: ruby:2.6
Christophe Trefois's avatar
Christophe Trefois committed
2

3
4
5
6
7
stages:
  - test
  - deploy
  - release

8
# This will try to build the web site, and store the result in "build" directory
Christophe Trefois's avatar
Christophe Trefois committed
9
10
test:
  stage: test
11
12
  variables:
    JEKYLL_ENV: production
Christophe Trefois's avatar
Christophe Trefois committed
13
  artifacts:
14
    expire_in: 3 days
Christophe Trefois's avatar
Christophe Trefois committed
15
    paths:
16
17
18
19
20
21
22
    - build  
  before_script:
  - bundle install
  script:  
  - 'echo "baseurl: /$CI_PROJECT_NAME" >> _config_ci.yml'
  - 'echo "url: https://$CI_PROJECT_NAMESPACE.$CI_PAGES_DOMAIN" >> _config_ci.yml'
  - bundle exec jekyll build -d build --config "_config.yml,_config_ci.yml"
Christophe Trefois's avatar
Christophe Trefois committed
23

24
# This will actually deploy the web site when pushing to master
Christophe Trefois's avatar
Christophe Trefois committed
25
26
pages:
  stage: deploy
27
28
  only:
  - master  
Christophe Trefois's avatar
Christophe Trefois committed
29
  script:
30
31
  - mv build public
  - echo "Your website is available at $CI_PAGES_URL"
Christophe Trefois's avatar
Christophe Trefois committed
32
  artifacts:
33
    expire_in: 3 days
Christophe Trefois's avatar
Christophe Trefois committed
34
35
36
    paths:
    - public

Jacek Lebioda's avatar
Jacek Lebioda committed
37
# This will push the gem to ruby-gems when tagged
38
39
40
release:
  stage: release
  script:
41
42
    - 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
43
44
  only:
    - tags