.circleci/sequential_basic_workflow.yml

Summary

Maintainability
Test Coverage
# Sequential Basic Workflow

version: 2
jobs:
  build:
    docker:
      - image: circleci/ruby:latest-node-browsers
        environment:
          TZ: '/usr/share/zoneinfo/Asia/Istanbul'
          RAILS_ENV: test
          RACK_ENV: test
          RDS_USERNAME: nokul
          RDS_PASSWORD: nokul
          RDS_HOSTNAME: localhost
          RDS_PORT: 5432
      - image: circleci/postgres:9.6.7
        environment:
          POSTGRES_DB: nokul_test
          POSTGRES_USER: nokul
          POSTGRES_PASSWORD: nokul
    steps:
      - checkout
      - restore_cache:
          keys:
            - gem-cache-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
            - gem-cache-{{ checksum "Gemfile.lock" }}
      - restore_cache:
          keys:
            - yarn-packages-{{ .Branch }}-{{ checksum "yarn.lock" }}
            - yarn-packages-{{ checksum "yarn.lock" }}

      - run: bundle install --path vendor/bundle --without development
      - run: bin/yarn install

      - save_cache:
          key: gem-cache-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
          paths:
            - vendor/bundle
      - save_cache:
          key: gem-cache-{{ checksum "Gemfile.lock" }}
          paths:
            - vendor/bundle
      - save_cache:
          key: yarn-packages-{{ .Branch }}-{{ checksum "yarn.lock" }}
          paths:
            - node_modules/
      - save_cache:
          key: yarn-packages-{{ checksum "yarn.lock" }}
          paths:
            - node_modules/
      - run: bundle exec rake quality:rails
      - run: bundle exec rake security:all
      - run: bundle exec rake db:migrate
      - run: bundle exec rake test
  deploy:
    machine:
      enabled: true
    steps:
      - checkout
      - run:
          name: Deploy Master to Dokku
          command: |
            git remote add beta dokku@app.omu.sh:nokul &&
            git push beta master

workflows:
  version: 2
  build-and-deploy:
    jobs:
      - build
      - deploy:
          requires:
            - build
          filters:
            branches:
              only: master