Skip to content

Instantly share code, notes, and snippets.

@bschwind
Created February 25, 2019 02:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bschwind/cb11c4c46710732b034ddcd99f3ab0d8 to your computer and use it in GitHub Desktop.
Save bschwind/cb11c4c46710732b034ddcd99f3ab0d8 to your computer and use it in GitHub Desktop.
cachekey_rust: &cachekey_rust
rust-cache-v1-{{ checksum "Cargo.lock" }}
version: 2
jobs:
build_backend:
docker:
- image: circleci/rust:1.32.0
working_directory: ~/workspace
steps:
- checkout
- restore_cache:
key: *cachekey_rust
- run: cargo build --release
- save_cache:
key: *cachekey_rust
paths:
- "~/.cargo"
- "./target"
- persist_to_workspace:
root: .
paths:
- target/release/YOUR_BINARY_HERE
- .env
deploy:
docker:
- image: circleci/rust:1.32.0
working_directory: ~/workspace
steps:
- add_ssh_keys
- attach_workspace:
at: .
- run: mv target/release/YOUR_BINARY_HERE YOUR_BINARY_HERE
- run: rm -r target/
- run: zip -r YOUR_BINARY_HERE.zip ./*
- store_artifacts:
path: YOUR_BINARY_HERE.zip
# - run: TODO - scp YOUR_BINARY_HERE.zip to your favorite server
workflows:
version: 2
build_and_test:
jobs:
- build_backend
- deploy:
requires:
- build_backend
filters:
branches:
only:
- master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment