Skip to content

Commit f0318d7

Browse files
committed
Apply cache actions for Docker CICD
1 parent 6b2172c commit f0318d7

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/docker_action.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,33 @@ jobs:
2626
- name: Generate secret key
2727
run: head -c16 /dev/urandom > src/secret.key
2828

29+
- name: Cache cargo registry
30+
uses: actions/cache@v1
31+
with:
32+
path: ~/.cargo/registry
33+
key: docker-registry-${{ hashFiles('**/Cargo.lock') }}
34+
restore-keys: |
35+
docker-registry-
36+
docker-
37+
38+
- name: Cache cargo index
39+
uses: actions/cache@v1
40+
with:
41+
path: ~/.cargo/git
42+
key: docker-index-${{ hashFiles('**/Cargo.lock') }}
43+
restore-keys: |
44+
docker-index-
45+
docker-
46+
47+
- name: Cache cargo build
48+
uses: actions/cache@v1
49+
with:
50+
path: target
51+
key: docker-build-${{ hashFiles('**/Cargo.lock') }}
52+
restore-keys: |
53+
docker-build-
54+
docker-
55+
2956
- name: Run cargo build
3057
uses: actions-rs/cargo@v1
3158
with:

0 commit comments

Comments
 (0)