diff --git a/jekyll/gitlab-ci.yml b/jekyll/gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..2f75311e8f2a3a32a6b6726446c6f85c17012dd1 --- /dev/null +++ b/jekyll/gitlab-ci.yml @@ -0,0 +1,78 @@ +image: ruby:latest + +stages: + - build + - deploy + +variables: +# JEKYLL_ENV: production + LC_ALL: C.UTF-8 + BUILD_DIR: public/ + DEPLOY_DIR: public_html/TLLALinearity2022/ + +cache: + paths: + - web/vendor/bundle/ + +.build: + stage: build + variables: + CONFIG: _config.yml + before_script: + - apt-get update -qy + - gem install bundler + - cd web/ + - bundle install --path vendor/bundle + script: + - bundle exec jekyll build -d $BUILD_DIR --config $CONFIG + artifacts: + paths: + - web/$BUILD_DIR + +.deploy: + stage: deploy + variables: + before_script: + - apt-get update -qy + - apt-get install -y lftp + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + - ssh-keyscan $SFTP_HOST >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + - cd web/ + script: + - lftp -e "set sftp:auto-confirm yes; + open sftp://$SFTP_HOST; + user $SFTP_USER $SFTP_PASSWORD; + mirror --exclude-glob .git* + --exclude .git/ + --reverse + --verbose + --delete + $BUILD_DIR + $DEPLOY_DIR; + bye" + +build.dev: + extends: .build + variables: + CONFIG: _config.yml,_config-dev.yml + only: + - web.dev + +build.prod: + extends: .build + only: + - web.prod + +deploy.dev: + extends: .deploy + variables: + DEPLOY_DIR: public_html/TLLA/dev/2022/ + only: + - web.dev + +deploy.prod: + extends: .deploy + only: + - web.prod