version: 2 jobs: build-website: # setting the working_directory along with the checkout path allows us to not have # to cd into the website/ directory for commands working_directory: ~/project/website docker: - image: hashicorp/middleman-hashicorp:0.3.35 steps: - checkout: path: ~/project - restore_cache: key: static-site-gems-v1-{{ checksum "Gemfile.lock" }} - run: command: bundle check || bundle install --path vendor/bundle - save_cache: key: static-site-gems-v1-{{ checksum "Gemfile.lock" }} paths: - ~/project/website/vendor/bundle - run: command: bundle exec middleman build - run: command: ./scripts/deploy.sh workflows: version: 2 website: jobs: - build-website: context: static-sites filters: branches: only: stable-website