Move before_script inside deploy job
This commit is contained in:
+10
-10
@@ -3,27 +3,27 @@ image: monachus/hugo
|
|||||||
variables:
|
variables:
|
||||||
GIT_SUBMODULE_STRATEGY: recursive
|
GIT_SUBMODULE_STRATEGY: recursive
|
||||||
|
|
||||||
before_script:
|
|
||||||
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client rsync -y )'
|
|
||||||
- eval $(ssh-agent -s)
|
|
||||||
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
|
|
||||||
- mkdir -p ~/.ssh
|
|
||||||
- chmod 700 ~/.ssh
|
|
||||||
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
|
|
||||||
- chmod 644 ~/.ssh/known_hosts
|
|
||||||
|
|
||||||
Run hugo test:
|
Run hugo test:
|
||||||
before_script: ~
|
|
||||||
script:
|
script:
|
||||||
- hugo
|
- hugo
|
||||||
except:
|
except:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
Deploy site:
|
Deploy site:
|
||||||
|
before_script:
|
||||||
|
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client rsync -y )'
|
||||||
|
- eval $(ssh-agent -s)
|
||||||
|
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
|
||||||
|
- mkdir -p ~/.ssh
|
||||||
|
- chmod 700 ~/.ssh
|
||||||
|
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
|
||||||
|
- chmod 644 ~/.ssh/known_hosts
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- hugo
|
- hugo
|
||||||
- rsync -av --delete --exclude presentations public/ james@shee.sh:/srv/www/jamesmcdonald
|
- rsync -av --delete --exclude presentations public/ james@shee.sh:/srv/www/jamesmcdonald
|
||||||
- echo "Purging CloudFlare cache"
|
- 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}"'
|
- '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:
|
only:
|
||||||
- master
|
- master
|
||||||
|
|||||||
Reference in New Issue
Block a user