Created
April 18, 2021 20:59
-
-
Save nagi1/6a19ddd5504f514fa701d1e58075baa3 to your computer and use it in GitHub Desktop.
Example bitbucket-pipeline.yaml that works with laravel envoy. See https://ahmednagi.com/laravel-deploy-bitbucket
This file contains 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
image: php:7.4-fpm | |
definitions: | |
steps: | |
- step: &composer-install | |
name: Build PHP | |
caches: | |
- composer | |
script: | |
- ls -al | |
- apt-get update && apt-get install -qy unzip git curl libmcrypt-dev | |
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | |
- composer --version | |
- composer install --no-ansi --no-dev --no-interaction --no-plugins --no-progress --no-scripts --optimize-autoloader --prefer-dist --ignore-platform-reqs | |
artifacts: | |
- vendor/** | |
- step: &npm-build | |
name: Build Assets | |
image: node:12.20 | |
caches: | |
- node | |
script: | |
- npm install | |
- npm run production | |
artifacts: | |
- public/** | |
- step: &deploy-production | |
name: Deploy (Production) | |
deployment: Production | |
caches: | |
- composer | |
script: | |
- apt-get update && apt-get install -qy unzip git curl libmcrypt-dev rsync | |
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | |
- composer --version | |
- composer global require "laravel/envoy" | |
- ~/.composer/vendor/bin/envoy run deploy --host=$DEPLOY_HOST --user=$DEPLOY_USER --path=$DEPLOY_PATH --build=$BITBUCKET_BUILD_NUMBER --commit=$BITBUCKET_COMMIT --branch=$BITBUCKET_BRANCH --php=php --dir=$BITBUCKET_CLONE_DIR | |
pipelines: | |
default: | |
- step: *composer-install | |
# - step: *npm-build | |
branches: | |
master: | |
- step: *composer-install | |
# - step: *npm-build | |
- step: *deploy-production | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment