Skip to content

Instantly share code, notes, and snippets.

@woganmay
Created September 11, 2019 20:41
Show Gist options
  • Save woganmay/11df93f4ed98fb5af8786ed3b80cb9b9 to your computer and use it in GitHub Desktop.
Save woganmay/11df93f4ed98fb5af8786ed3b80cb9b9 to your computer and use it in GitHub Desktop.
Bitbucket CI Pipeline - Deploy Laravel Vapor
# Prerequisites:
# 1. Have the laravel/vapor-cli dependency in your project, so that composer install catches it
# 2. Set the VAPOR_API_TOKEN environment variable to your Vapor API key
# Details in the documentation: https://docs.vapor.build/1.0/projects/deployments.html#deploying-from-ci
# This pipeline will build a PHP 7.2 environment with dependencies, run the standard
# phpunit tests, then deploy to the staging environment on Vapor.
image: php:7.2.22-alpine
pipelines:
default:
- step:
caches:
- composer
script:
- apk update && apk add unzip npm
- apk add --no-cache libzip-dev && docker-php-ext-configure zip --with-libzip=/usr/include && docker-php-ext-install zip
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install
- echo 'APP_KEY=' > .env
- php artisan key:generate
- vendor/bin/phpunit
- vendor/bin/vapor deploy staging --commit="$BITBUCKET_COMMIT"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment