-
-
Save aiiddqd/eafc65022ba1f3a8b84bdfd44e3376d4 to your computer and use it in GitHub Desktop.
Deploy from GitLab to WPEngine (Tested)
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
stages: | |
- deploy_dev | |
- deploy_staging | |
- deploy_live | |
before_script: | |
- 'which ssh-agent || ( apk add --update openssh )' | |
- apk add --update bash | |
- apk add --update git | |
- eval $(ssh-agent -s) | |
- echo "$SSH_PRIVATE_KEY" | |
- echo "$SSH_PRIVATE_KEY" | ssh-add - | |
- mkdir -p ~/.ssh | |
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' | |
Deploy Dev: | |
stage: deploy_dev | |
script: | |
- git remote add dev $WPENGINE_DEV_GIT | |
- "git checkout -b dev" | |
- "git push dev HEAD:master --force" | |
only: | |
- develop | |
Deploy Staging: | |
stage: deploy_staging | |
script: | |
- git remote add staging $WPENGINE_STAGING_GIT | |
- "git checkout -b staging" | |
- "git push staging HEAD:master --force" | |
only: | |
- master | |
Deploy Live: | |
stage: deploy_live | |
when: manual | |
script: | |
- git remote add live $WPENGINE_LIVE_GIT | |
- "git checkout -b live" | |
- "git push live HEAD:master --force" | |
only: | |
- tags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment