diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..eed549727 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,42 @@ +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 + + # restores gem cache + - restore_cache: + key: static-site-gems-v1-{{ checksum "Gemfile.lock" }} + + - run: + command: bundle check || bundle install --path vendor/bundle + + # saves gem cache if we have changed the Gemfile + - save_cache: + key: static-site-gems-v1-{{ checksum "Gemfile.lock" }} + paths: + - ~/project/website/vendor/bundle + + # middleman build + - run: + command: bundle exec middleman build + + # website deploy + - run: + command: ./scripts/deploy.sh + +workflows: + version: 2 + website: + jobs: + - build-website: + context: static-sites + filters: + branches: + only: stable-website diff --git a/website/packer.json b/website/packer.json deleted file mode 100644 index c57fa74ef..000000000 --- a/website/packer.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "variables": { - "aws_access_key_id": "{{ env `AWS_ACCESS_KEY_ID` }}", - "aws_secret_access_key": "{{ env `AWS_SECRET_ACCESS_KEY` }}", - "aws_region": "{{ env `AWS_REGION` }}", - "website_environment": "production", - "fastly_api_key": "{{ env `FASTLY_API_KEY` }}" - }, - "builders": [ - { - "type": "docker", - "image": "hashicorp/middleman-hashicorp:0.3.35", - "discard": "true", - "volumes": { - "{{ pwd }}": "/website" - } - } - ], - "provisioners": [ - { - "type": "shell", - "environment_vars": [ - "AWS_ACCESS_KEY_ID={{ user `aws_access_key_id` }}", - "AWS_SECRET_ACCESS_KEY={{ user `aws_secret_access_key` }}", - "AWS_REGION={{ user `aws_region` }}", - "ENV={{ user `website_environment` }}", - "FASTLY_API_KEY={{ user `fastly_api_key` }}" - ], - "inline": [ - "bundle check || bundle install", - "bundle exec middleman build", - "/bin/bash ./scripts/deploy.sh" - ] - } - ] -}