Created
September 13, 2016 20:19
-
-
Save comilab/06ac9f3daddd7d3cac6a309564aa9761 to your computer and use it in GitHub Desktop.
GitLab.com + GitLab-CI + Shared runners + gulp + rsyncで自動デプロイ
This file contains 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
image: node:latest | |
cache: | |
paths: | |
- node_modules/ | |
before_script: | |
- apt-get update -y | |
- apt-get install rsync openssh-client -y | |
- npm install | |
stages: | |
- deploy | |
job_deploy: | |
stage: deploy | |
environment: production | |
only: | |
- master | |
script: | |
- npm run build | |
- 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' | |
- rsync -avz --delete ./public "${SERVER_USER}@${SERVER_HOST}:${SERVER_DEST}" | |
artifacts: | |
paths: | |
- public |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment