-
-
Save bschwind/cb11c4c46710732b034ddcd99f3ab0d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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