2018-03-12 19:31:14 +00:00
|
|
|
|
2021-04-21 13:33:28 +00:00
|
|
|
image: node:12.22.1
|
2018-03-12 19:31:14 +00:00
|
|
|
|
2019-03-24 14:23:05 +00:00
|
|
|
hexo:
|
|
|
|
stage: build
|
|
|
|
before_script:
|
|
|
|
- npm install gulp -g
|
|
|
|
- npm install hexo-cli -g
|
|
|
|
- npm install
|
2018-03-12 19:31:14 +00:00
|
|
|
script:
|
2019-03-24 14:23:05 +00:00
|
|
|
- gulp build --cwd ./themes/starter
|
|
|
|
- hexo generate
|
2018-03-12 19:31:14 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2019-03-24 14:23:05 +00:00
|
|
|
- public/
|
2018-03-15 02:06:18 +00:00
|
|
|
cache:
|
|
|
|
paths:
|
2019-03-24 14:23:05 +00:00
|
|
|
- node_modules/
|
2018-03-15 02:06:18 +00:00
|
|
|
key: project
|
2019-03-24 14:23:05 +00:00
|
|
|
only:
|
2020-10-12 18:52:48 +00:00
|
|
|
- main
|
2019-03-24 14:23:05 +00:00
|
|
|
|
|
|
|
htmlproofer:
|
|
|
|
stage: test
|
2021-10-22 20:36:25 +00:00
|
|
|
image: olikami/htmlproofer:latest # fork of 18fgsa/html-proofer
|
2019-03-24 17:15:00 +00:00
|
|
|
only:
|
2019-04-01 12:43:26 +00:00
|
|
|
variables:
|
|
|
|
- $CI_COMMIT_MESSAGE =~ /htmlproofer/
|
2019-03-24 14:23:05 +00:00
|
|
|
script:
|
2021-10-22 20:36:25 +00:00
|
|
|
- htmlproofer public/ --external-only --checks-to-ignore ScriptCheck,ImageCheck
|
2019-03-24 14:23:05 +00:00
|
|
|
dependencies:
|
|
|
|
- hexo
|
2018-03-15 02:06:18 +00:00
|
|
|
|
2019-03-24 14:23:05 +00:00
|
|
|
pages:
|
|
|
|
stage: deploy
|
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: none
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- public/
|
|
|
|
dependencies:
|
|
|
|
- hexo
|
|
|
|
script:
|
|
|
|
- echo 'Deploying...'
|
2018-03-12 19:31:14 +00:00
|
|
|
only:
|
2020-10-12 18:52:48 +00:00
|
|
|
- main
|
2018-10-17 20:27:04 +00:00
|
|
|
|
|
|
|
cert-renewal:
|
|
|
|
only:
|
|
|
|
- schedules
|
|
|
|
variables:
|
|
|
|
CERTBOT_RENEWAL_GIT_TOKEN: $CERTBOT_RENEWAL_GIT_TOKEN
|
|
|
|
script:
|
2019-04-02 18:41:14 +00:00
|
|
|
- echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/sources.list
|
2018-10-17 20:27:04 +00:00
|
|
|
- apt-get update
|
2019-04-02 18:41:14 +00:00
|
|
|
- apt-get install certbot -t stretch-backports -y
|
2018-10-17 20:27:04 +00:00
|
|
|
- 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
|