Created
May 25, 2019 15:47
-
-
Save jcqtc/f7d055e22c77bf20af3e726fce09e770 to your computer and use it in GitHub Desktop.
CircleCI deployment configuration using PHP Deployer
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
| version: 2 | |
| jobs: | |
| build: | |
| docker: | |
| - image: circleci/php:7.2-browsers | |
| working_directory: ~/code | |
| steps: | |
| - checkout | |
| - run: | |
| name: Copy .env.testing file | |
| command: cp .env.testing .env | |
| - restore_cache: | |
| keys: | |
| - composer-{{ .Branch }}-{{ checksum "composer.json" }} | |
| - composer-{{ .Branch }}- | |
| - composer- | |
| - run: | |
| name: Install Composer Dependencies | |
| command: composer install --no-interaction --prefer-dist --ignore-platform-reqs | |
| - save_cache: | |
| key: composer-{{ .Branch }}-{{ checksum "composer.json" }} | |
| paths: | |
| - vendor | |
| - run: | |
| name: Create SQLite Database | |
| command: touch database/database.sqlite | |
| - run: | |
| name: Run Laravel Migrations | |
| command: php artisan migrate --force | |
| - run: | |
| name: Run Laravel Server | |
| command: php artisan serve | |
| background: true | |
| - run: | |
| name: Run Chrome Driver | |
| command: ./vendor/laravel/dusk/bin/chromedriver-linux | |
| background: true | |
| - run: | |
| name: Run PHPUnit | |
| command: vendor/bin/phpunit | |
| - run: | |
| name: Run Laravel Dusk | |
| command: php artisan dusk | |
| - store_artifacts: | |
| path: tests/Browser/screenshots | |
| destination: dusk-screenshots | |
| - store_artifacts: | |
| path: tests/Browser/console | |
| destination: dusk-console | |
| - store_artifacts: | |
| path: storage/logs | |
| destination: laravel-logs | |
| deploy: | |
| docker: | |
| - image: circleci/php:7.2 | |
| working_directory: ~/code | |
| steps: | |
| - checkout | |
| - run: | |
| name: Copy .env.testing to .env | |
| command: cp .env.testing .env | |
| - restore_cache: | |
| keys: | |
| - composer-{{ .Branch }}-{{ checksum "composer.json" }} | |
| - run: | |
| name: Install Composer Dependencies | |
| command: composer install --no-interaction --prefer-dist --ignore-platform-reqs | |
| - add_ssh_keys: | |
| fingerprints: | |
| - "f6:1c:2b:d8:3c:ed:3f:77:ee:6d:46:5a:45:f9:cf:49" | |
| - run: | |
| name: Unlock Deployment | |
| command: vendor/bin/dep deploy:unlock $CIRCLE_BRANCH | |
| - run: | |
| name: Deployment Using Deployer | |
| command: vendor/bin/dep deploy $CIRCLE_BRANCH | |
| workflows: | |
| version: 2 | |
| build-and-deploy: | |
| jobs: | |
| - build | |
| - deploy: | |
| requires: | |
| - build | |
| filters: | |
| branches: | |
| only: | |
| - master | |
| - develop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment