Last active
January 30, 2023 20:02
-
-
Save IronGhost63/24c9e8f791f3307dfed6ded17d957810 to your computer and use it in GitHub Desktop.
Auto deploy master to Cloudways
This file contains hidden or 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
| # 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 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create Pipelines SSH Key Pair in BitBucket repo and add to Cloudways Application
Add env variable to Pipelines configuration