Skip to content

Instantly share code, notes, and snippets.

@sean-e-dietrich
Created March 23, 2018 19:24
Show Gist options
  • Save sean-e-dietrich/4b6c0d9323fd04857c09866ab59e96c1 to your computer and use it in GitHub Desktop.
Save sean-e-dietrich/4b6c0d9323fd04857c09866ab59e96c1 to your computer and use it in GitHub Desktop.
CircleCI config.yml file
# PHP CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-php/ for more details
#
defaults: &defaults
docker:
- image: circleci/php:5.6-apache-node-browsers
working_directory: ~/repo
version: 2
jobs:
build:
<<: *defaults
steps:
- checkout
- persist_to_workspace:
root: ~/
paths:
- repo
deploy_stage:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
name: Deploying to Staging
command: ./.circleci/deploy STG
deploy_prod:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
name: Deploying to Production
command: ./.circleci/deploy PROD
workflows:
version: 2
build-n-deploy:
jobs:
- build
- deploy_stage:
requires:
- build
filters:
branches:
only: master
- deploy_prod:
requires:
- build
filters:
branches:
ignore: /.*/
tags:
only: /^prod-.*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment