Forked from anilnautiyal/For WPengine (.gitlab-ci.yml)
Created
February 4, 2019 10:58
-
-
Save dfroberg/1511647ccb057129a72d8e92e84b92a3 to your computer and use it in GitHub Desktop.
.gitlab-ci.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
before_script: | |
- mkdir -p ~/.ssh | |
- eval $(ssh-agent -s) | |
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' | |
- echo "$PRIVATEKEY" | tr -d '\r' | ssh-add - > /dev/null | |
stages: | |
- deploy_staging | |
- deploy_master | |
Deploy Master: | |
stage: deploy_master | |
script: | |
- git remote add production $production-remote-url | |
- "git checkout -b master" | |
- "git push production master:master -f" | |
only: | |
- master | |
Deploy Staging: | |
stage: deploy_staging | |
script: | |
- git remote add staging $staging-remote-url | |
- "git checkout -b staging" | |
- "git push staging staging:master -f" | |
only: | |
- staging |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment