Move before_script inside deploy job

This commit is contained in:
2019-02-07 18:14:00 +01:00
parent 78563ec94d
commit 269fb2d312
+8 -8
View File
@@ -3,6 +3,13 @@ image: monachus/hugo
variables:
GIT_SUBMODULE_STRATEGY: recursive
Run hugo test:
script:
- hugo
except:
- master
Deploy site:
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client rsync -y )'
- eval $(ssh-agent -s)
@@ -12,18 +19,11 @@ before_script:
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
Run hugo test:
before_script: ~
script:
- hugo
except:
- master
Deploy site:
script:
- hugo
- rsync -av --delete --exclude presentations public/ james@shee.sh:/srv/www/jamesmcdonald
- echo "Purging CloudFlare cache"
- 'curl -s -X POST "https://api.cloudflare.com/client/v4/zones/8f213feeb6709de2ba2b70dd5cfa704e/purge_cache" -H "X-Auth-Email: $CLOUDFLARE_EMAIL" -H "X-Auth-Key: $CLOUDFLARE_KEY" -H "Content-Type: application/json" --data "{\"purge_everything\": true}"'
only:
- master