diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000000..89b12067cd --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,43 @@ +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: + name: install gems + command: bundle check || bundle install --path vendor/bundle --retry=3 + + # saves gem cache if we have changed the Gemfile + - save_cache: + key: static-site-gems-v1-{{ checksum "Gemfile.lock" }} + paths: + - ~/project/website/vendor/bundle + + - run: + name: middleman build + command: bundle exec middleman build + + - run: + name: website deploy + 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 c57fa74efb..0000000000 --- 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" - ] - } - ] -}