Fix deploy.sh II

This commit is contained in:
mcarton 2016-07-19 22:42:09 +02:00
parent c6c8560861
commit e8c54edfe1

20
.github/deploy.sh vendored
View File

@ -39,6 +39,16 @@ if [ "$TRAVIS_PULL_REQUEST" != "false" ] || [ "$TRAVIS_BRANCH" != "$SOURCE_BRANC
exit 0
fi
# Get the deploy key by using Travis's stored variables to decrypt deploy_key.enc
ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key"
ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv"
ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR}
ENCRYPTED_IV=${!ENCRYPTED_IV_VAR}
openssl aes-256-cbc -K "$ENCRYPTED_KEY" -iv "$ENCRYPTED_IV" -in github/deploy_key.enc -out github/deploy_key -d
chmod 600 github/deploy_key
eval $(ssh-agent -s)
ssh-add github/deploy_key
# Now let's go have some fun with the cloned repo
cd out
git config user.name "Travis CI"
@ -53,15 +63,5 @@ fi
git add .
git commit -m "Automatic deploy to GitHub Pages: ${SHA}"
# Get the deploy key by using Travis's stored variables to decrypt deploy_key.enc
ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key"
ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv"
ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR}
ENCRYPTED_IV=${!ENCRYPTED_IV_VAR}
openssl aes-256-cbc -K "$ENCRYPTED_KEY" -iv "$ENCRYPTED_IV" -in deploy_key.enc -out deploy_key -d
chmod 600 deploy_key
eval $(ssh-agent -s)
ssh-add deploy_key
# Now that we're all set up, we can push.
git push "$SSH_REPO" "$TARGET_BRANCH"