Skip to content

Instantly share code, notes, and snippets.

@bryanleetc
Last active January 9, 2019 17:43
Show Gist options
  • Save bryanleetc/41640a13eba755d117a6a3f13f2b4820 to your computer and use it in GitHub Desktop.
Save bryanleetc/41640a13eba755d117a6a3f13f2b4820 to your computer and use it in GitHub Desktop.
Medium - Laravel CircleCI Deployer
version: 2
jobs:
build:
docker:
# Specify the version you desire here
- image: circleci/php:7.1-browsers
- image: circleci/mysql:5.7
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_USER: root
MYSQL_ROOT_PASSWORD: ''
MYSQL_DATABASE: laravel
working_directory: ~/laravel
steps:
- checkout
- run:
name: Install PHP exts
command: |
sudo docker-php-ext-install zip
sudo docker-php-ext-install pdo_mysql
sudo apt install -y mysql-client
- run: sudo composer self-update
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "composer.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: composer install -n --prefer-dist
- save_cache:
paths:
- ./vendor
key: v1-dependencies-{{ checksum "composer.json" }}
- run:
name: Setup Laravel stuffs
command: |
php artisan migrate --force
- run: ./vendor/bin/phpunit
workflows:
version: 2
notify_deploy:
jobs:
- build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment