Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Auto deploy master to Cloudways
# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: oneko/php-7.1-node-yarn
pipelines:
branches:
master:
- step:
name: Build & Deploy
caches:
- node
- composer
deployment: production
script:
- echo "> Looking for theme directory"
- X=`/bin/ls -d wp-content/themes/*/ | grep -v "\/twenty" | head -1`
- if [ $X ]; then echo '- Found:' $X; cd $X; else echo 'No WordPress themes found'; fi
- echo "> Building assets"
- composer install
- yarn
- yarn run build:production
- echo "- Asset built successful"
- cd -
- echo "> Deploying to" $DEPLOY_HOST
- rsync -azP --exclude .git --exclude .gitignore --exclude bitbucket-pipelines.yml . $DEPLOY_USER@$DEPLOY_HOST:public_html
@IronGhost63

This comment has been minimized.

Copy link
Owner Author

@IronGhost63 IronGhost63 commented Jun 21, 2018

Create Pipelines SSH Key Pair in BitBucket repo and add to Cloudways Application

Add env variable to Pipelines configuration

  • DEPLOY_HOST Server Address
  • DEPLOY_USER Application Username
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment