Skip to content

Commit

Permalink
Add deployment (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ned Zimmerman authored Sep 7, 2019
1 parent 6bb7e69 commit 01c5a0f
Showing 1 changed file with 45 additions and 1 deletion.
46 changes: 45 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,53 @@ jobs:
npm ci
npm run test
npm run build
deploy_theme_staging:
docker:
- image: circleci/php:7.3-node-browsers
steps:
- checkout
- add_ssh_keys:
fingerprints:
- "c0:36:87:5e:a5:8f:b7:6e:62:d0:3e:3f:de:56:06:56"
- run:
name: "Build theme"
command: |
yarn
yarn build:production
composer install --no-dev --optimize-autoloader
- run: sudo apt-get install -y lftp
- run: lftp -c 'set sftp:auto-confirm yes; set sftp:connect-program "ssh -p 22222 -a -x -i ~/.ssh/id_rsa"; connect sftp://'"$SFTP_USERNAME"':'"$SFTP_PASSWORD"'@'"$SFTP_HOSTNAME"' -e "mirror -v -R --exclude docs/ --exclude .cache-loader/ --exclude .git/ --exclude .circleci/ --exclude node_modules/ --exclude resources/assets/ ./ '"$WEB_ROOT_STAGING"'/wp-content/themes/'"$THEME_NAME"'; quit"'
deploy_theme_production:
docker:
- image: circleci/php:7.3-node-browsers
steps:
- checkout
- add_ssh_keys:
fingerprints:
- "c0:36:87:5e:a5:8f:b7:6e:62:d0:3e:3f:de:56:06:56"
- run:
name: "Build theme"
command: |
yarn
yarn build:production
composer install --no-dev --optimize-autoloader
- run: sudo apt-get install -y lftp
- run: lftp -c 'set sftp:auto-confirm yes; set sftp:connect-program "ssh -p 22222 -a -x -i ~/.ssh/id_rsa"; connect sftp://'"$SFTP_USERNAME"':'"$SFTP_PASSWORD"'@'"$SFTP_HOSTNAME"' -e "mirror -v -R --exclude docs/ --exclude .cache-loader/ --exclude .git/ --exclude .circleci/ --exclude node_modules/ --exclude resources/assets/ ./ '"$WEB_ROOT_PRODUCTION"'/wp-content/themes/'"$THEME_NAME"'; quit"'

workflows:
version: 2
test:
test_and_deploy:
jobs:
- test
- deploy_theme_staging:
requires:
- test
filters:
branches:
only: dev
# - deploy_theme_production:
# requires:
# - test
# filters:
# branches:
# only: master

0 comments on commit 01c5a0f

Please sign in to comment.