Update .gitlab-ci.yml file

This commit is contained in:
Aaron Riedel 2022-03-06 10:32:29 +00:00
parent cef3e51ccd
commit b257103901

View file

@ -3,6 +3,8 @@ stages: # List of stages for jobs, and their order of execution
- test
- deploy
image: debian
docker-build:
# Use the official docker image.
image: docker:latest
@ -29,5 +31,23 @@ docker-build:
- if: $CI_COMMIT_BRANCH
exists:
- Dockerfile
- if: $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "dev"
- if: ($CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "dev")
when: always
before_script:
- apt-get update -qq
- apt-get install -qq git
# Setup SSH deploy keys
- 'which ssh-agent || ( apt-get install -qq openssh-client )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
deploy_staging:
type: deploy
script:
- ssh $SSH_SERVER "cd /root && docker-compose up -d shbot && exit"
only:
- master