Skip to content

Instantly share code, notes, and snippets.

@EtienneDepaulis
Created December 8, 2018 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EtienneDepaulis/71e85b08b0111347daa58105638c4dbd to your computer and use it in GitHub Desktop.
Save EtienneDepaulis/71e85b08b0111347daa58105638c4dbd to your computer and use it in GitHub Desktop.
CircleCi notifications article - CircleCI final configuration
# .circleci/config.yml
version: 2
jobs:
test:
docker:
- image: circleci/ruby:2.5.3-node-browsers
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- gems-{{ checksum "Gemfile.lock" }}
- run:
name: Install dependencies
command: |
bundle install --path vendor/bundle
- save_cache:
key: gems-{{ checksum "Gemfile.lock" }}
paths:
- ~/repo/vendor/bundle
- run:
name: Run specs
command: bundle exec rspec spec
- store_test_results:
path: ~/rspec
deploy_prod:
docker:
- image: circleci/ruby:2.5.3-node-browsers
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- gems-{{ checksum "Gemfile.lock" }}
- run: bundle --path vendor/bundle
- run:
name: Install Serverless CLI
command: |
sudo npm i -g serverless
- run:
name: Deploy
command: sls deploy -s prod
workflows:
version: 2
main:
jobs:
- test
- deploy_prod:
requires:
- test
filters:
branches:
only: master
notify:
webhooks:
- url: https://execute-api.eu-west-1.amazonaws.com/prod/notify_author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment