Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deployment #50

Merged
merged 1 commit into from
Sep 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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