Skip to content

Instantly share code, notes, and snippets.

@Zoramite
Last active June 24, 2019 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zoramite/93f81a5a58afcb8cbbc474c891ff591c to your computer and use it in GitHub Desktop.
Save Zoramite/93f81a5a58afcb8cbbc474c891ff591c to your computer and use it in GitHub Desktop.
Complex Grow Workflow for Large Sites
version: 2
shortcuts:
restore_cache: &restore_cache
keys:
- &cache_key cache-{{ .Branch }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}
install_grow: &install_grow
name: Grow Install
command: grow install
save_cache: &save_cache
key: *cache_key
paths:
- node_modules
persist: &persist
root: ~/grow
paths:
- build/
jobs:
build-a:
working_directory: ~/grow
docker:
- image: grow/base:master
steps:
- checkout
- restore_cache:
<<: *restore_cache
- run:
<<: *install_grow
- save_cache:
<<: *save_cache
- run:
name: Grow Build
# Deployment is used to build with a specific deployment environment.
# Should be updated to use the name of the deployment from podspec.
# Can be removed if you do not use a deployment environment.
command: grow build --shards=3 --shard=1 --deployment=prod
- persist_to_workspace:
<<: *persist
build-b:
working_directory: ~/grow
docker:
- image: grow/base:master
steps:
- checkout
- restore_cache:
<<: *restore_cache
- run:
<<: *install_grow
- save_cache:
<<: *save_cache
- run:
name: Grow Build
command: grow build --shards=3 --shard=2 --deployment=prod
- persist_to_workspace:
<<: *persist
build-c:
working_directory: ~/grow
docker:
- image: grow/base:master
steps:
- checkout
- restore_cache:
<<: *restore_cache
- run:
<<: *install_grow
- save_cache:
<<: *save_cache
- run:
name: Grow Build
command: grow build --shards=3 --shard=3 --deployment=prod
- persist_to_workspace:
<<: *persist
deploy:
working_directory: ~/grow
docker:
- image: grow/base:master
steps:
- attach_workspace:
at: ~/grow
- run:
name: Deploy
command: grow deploy prod -np --work-dir=build
workflows:
version: 2
build_and_deploy:
jobs:
- build-a
- build-b
- build-c
- deploy:
requires:
- build-a
- build-b
- build-c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment