Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
105 lines (103 sloc) 2.72 KB
version: 2.1
orbs:
pulumi: pulumi/pulumi@1.0.0
jobs:
provision:
docker:
- image: circleci/node:11
steps:
- checkout
- pulumi/login
- run:
name: Install Pulumi packages
command: yarn install --prod
- pulumi/update:
stack: prod
skip-preview: true
generate:
docker:
- image: rarous/cci-openjdk11-php7-clojure-tools-deps:latest
steps:
- checkout
- attach_workspace:
at: .
- restore_cache:
name: Restore deps cache
keys:
- v3-dependencies-{{ checksum "generator/deps.edn" }}
- run:
name: Generate static web site content
command: |
pushd generator
clojure -m rarousnet.generator ../
popd
- save_cache:
name: Store deps cache
key: v3-dependencies-{{ checksum "generator/deps.edn" }}
paths:
- ~/.m2
- generator/.cpcache
- persist_to_workspace:
root: .
paths: dist
postprocess:
docker:
- image: circleci/node:11-browsers
steps:
- checkout
- attach_workspace:
at: .
- restore_cache:
name: Restore yarn cache
keys:
- v2-dependencies-{{ checksum "yarn.lock" }}
- run: yarn install
- run:
name: Generate Twitter Card images
command: |
mv ./dist/weblog/data.json ./cards
node ./cards/generator "file://`pwd -P`/cards/card.html"
- run:
name: Postprocess resources
command: yarn build:assets
- save_cache:
name: Store yarn cache
key: v2-dependencies-{{ checksum "yarn.lock" }}
paths:
- ~/.yarn
- node_modules
- persist_to_workspace:
root: .
paths: dist
s3_deploy:
docker:
- image: cibuilds/aws:latest
steps:
- attach_workspace:
at: .
- run:
name: Deploy to S3
command: aws s3 sync --size-only --quiet "dist/" "s3://www.rarous.net/"
- run:
name: Update MIME types
command: aws s3 cp --exclude "*" --include "*.rss" --content-type="application/rss+xml; charset=utf-8" --metadata-directive="REPLACE" --recursive s3://www.rarous.net/ s3://www.rarous.net/
workflows:
build_and_deploy:
jobs:
- generate
- postprocess:
requires:
- generate
- provision:
context: aws
filters:
branches:
only: master
- s3_deploy:
context: aws
requires:
- provision
- postprocess
filters:
branches:
only: master