From 5f8e0612d48889e77dbb0e016a633c8d5181221f Mon Sep 17 00:00:00 2001 From: Ariejan de Vroom Date: Mon, 4 Sep 2017 15:39:20 +0200 Subject: [PATCH] Updated ci script --- .gitlab-ci.yml | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2405d7f..e87f597 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,28 +1,29 @@ -image: ariejan/dockerized-hugo +image: ariejan/dockerized-hugo:0.26 -stages: - - build - - deploy - -build: - stage: build +test: script: - hugo + except: + - master + +pages: + before_script: + # Setup SSH keys + - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' + - eval $(ssh-agent -s) + - ssh-add <(echo "$SSH_PRIVATE_KEY") + - mkdir -p ~/.ssh + - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' + + script: + # Compile + - hugo + + # Compress CSS - yui-compressor public/css/outerspace.css -o public/css/outerspace-min.css - mv -f public/css/outerspace-min.css public/css/outerspace.css - artifacts: - paths: - - public -deploy_prod: - stage: deploy - script: - #- s3cmd sync --acl-public --reduced-redundancy --delete-removed --cf-invalidate public/* s3://$AWS_BUCKET - - mkdir -p ~/.ssh - - echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa - - ls -lah ~/.ssh/id_rsa* - - chmod 700 ~/.ssh - - chmod 600 ~/.ssh/id_rsa + # Deploy - rsync -az4 --stats --delete-after public/* -e "ssh -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" ariejan@mail.devroom.io:/home/ariejan/www/devroom.io/ artifacts: paths: