Enhance Docker build workflow with caching for cargo tools and registry

This commit is contained in:
Goldy
2025-08-17 15:46:13 +02:00
parent ee52d65667
commit b89957fd41
+13 -2
View File
@@ -23,21 +23,32 @@ jobs:
with:
targets: x86_64-unknown-linux-musl,aarch64-unknown-linux-musl
- name: Cache cargo tools
id: cache-tools
uses: actions/cache@v3
with:
path: ~/.cargo/bin
key: ${{ runner.os }}-cargo-tools-cross-trunk
- name: Install cross
if: steps.cache-tools.outputs.cache-hit != 'true'
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Install trunk
if: steps.cache-tools.outputs.cache-hit != 'true'
run: cargo install trunk
- name: Cache cargo registry
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
${{ runner.os }}-cargo-
- name: Extract branch name