Skip to content

Instantly share code, notes, and snippets.

@wpscholar
Created April 22, 2019 23:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpscholar/3f40f56671a806ff5b4695c03ff6301a to your computer and use it in GitHub Desktop.
Save wpscholar/3f40f56671a806ff5b4695c03ff6301a to your computer and use it in GitHub Desktop.
CircleCI Rsync Deployment
version: 2
jobs:
build_and_deploy:
docker:
- image: circleci/php:7.1-node-browsers
steps:
- checkout
- run: sudo apt update
- run: sudo apt-get install rsync
- run: sudo docker-php-ext-install zip
- restore_cache:
keys:
- v1-dependencies-{{ checksum "composer.lock" }}
- v1-dependencies-
- run: composer install --no-interaction --no-dev --prefer-dist --optimize-autoloader
- save_cache:
key: v1-dependencies-{{ checksum "composer.lock" }}
paths:
- ./vendor
- add_ssh_keys:
fingerprints:
- ba:f5:b5:c4:68:f7:ed:2a:bc:8f:05:cd:57:f4:b3:53
- run:
name: Deploy Over SSH
command: |
rsync . -acvz --delete-after --force --include-from=.circleci/.rsyncinclude --exclude-from=.circleci/.rsyncignore -e "ssh -i ba:f5:b5:c4:68:f7:ed:2a:bc:8f:05:cd:57:f4:b3:53 -o 'StrictHostKeyChecking no'" $SSH_USER@$SSH_HOST:public_html --chmod=D755,F644
workflows:
version: 2
workflow:
jobs:
- build_and_deploy:
filters:
branches:
only:
- master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment