.gitlab-ci.yml 1.43 KB
Newer Older
lostinlight's avatar
lostinlight committed
1

2
image: node:10.15.0
lostinlight's avatar
lostinlight committed
3

lostinlight's avatar
lostinlight committed
4 5 6 7 8 9
hexo:
  stage: build
  before_script:
    - npm install gulp -g
    - npm install hexo-cli -g
    - npm install
lostinlight's avatar
lostinlight committed
10
  script:
lostinlight's avatar
lostinlight committed
11 12
    - gulp build --cwd ./themes/starter
    - hexo generate
lostinlight's avatar
lostinlight committed
13 14
  artifacts:
    paths:
lostinlight's avatar
lostinlight committed
15
      - public/
lostinlight's avatar
lostinlight committed
16 17
  cache:
    paths:
lostinlight's avatar
lostinlight committed
18
      - node_modules/
lostinlight's avatar
lostinlight committed
19
    key: project
lostinlight's avatar
lostinlight committed
20 21 22 23 24 25
  only:
    - master

htmlproofer:
  stage: test
  image: bobik/html-proofer-docker:gitlabci # fork of 18fgsa/html-proofer
26
  only:
27 28
    variables:
      - $CI_COMMIT_MESSAGE =~ /htmlproofer/
lostinlight's avatar
lostinlight committed
29
  script:
lostinlight's avatar
lostinlight committed
30
    - htmlproofer public/ --url-ignore "/fediverse.network/,/howto.disroot.org/,/f-droid.org/" --external-only --checks-to-ignore ScriptCheck,ImageCheck
lostinlight's avatar
lostinlight committed
31 32
  dependencies:
    - hexo
lostinlight's avatar
lostinlight committed
33

lostinlight's avatar
lostinlight committed
34 35 36 37 38 39 40 41 42 43 44
pages:
  stage: deploy
  variables:
    GIT_STRATEGY: none
  artifacts:
    paths:
      - public/
  dependencies:
    - hexo
  script:
    - echo 'Deploying...'
lostinlight's avatar
lostinlight committed
45
  only:
lostinlight's avatar
lostinlight committed
46
    - master
47 48 49 50 51 52 53

cert-renewal:
  only:
    - schedules
  variables:
    CERTBOT_RENEWAL_GIT_TOKEN: $CERTBOT_RENEWAL_GIT_TOKEN
  script:
lostinlight's avatar
lostinlight committed
54
    - echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/sources.list
55
    - apt-get update
lostinlight's avatar
lostinlight committed
56
    - apt-get install certbot -t stretch-backports -y
57 58 59 60 61 62 63
    - apt-get install git curl -y
    - export PATH=$PATH:$CI_PROJECT_DIR
    - git config --global user.name $GITLAB_USER_LOGIN
    - git config --global user.email $GITLAB_USER_EMAIL
    - chmod +x  ./letsencrypt_generate.sh
    - chmod +x  ./letsencrypt_authenticator.sh
    - ./letsencrypt_generate.sh