|
92 | 92 | # name: ${{ inputs.image_name }} |
93 | 93 | # bucket: ${{ inputs.bucket }} |
94 | 94 |
|
| 95 | + RUN --mount=type=cache,sharing=shared,id=,target=${CARGO_HOME}/registry/index \ |
| 96 | + --mount=type=cache,sharing=shared,id=cargo_registry_cache,target=${CARGO_HOME}/registry/cache \ |
| 97 | + --mount=type=cache,sharing=shared,id=cargo_git,target=${CARGO_HOME}/git/db \ |
| 98 | + |
| 99 | + - name: Cargo cache for Docker |
| 100 | + uses: actions/cache@v4 |
| 101 | + id: cargo-cache |
| 102 | + with: |
| 103 | + path: | |
| 104 | + ../cargo-cache-registry-index |
| 105 | + ../cargo-cache-registry-cache |
| 106 | + ../cargo-cache-git-db |
| 107 | + key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} |
| 108 | + restore-keys: |
| 109 | + - ${{ runner.os }}-cargo- |
| 110 | + |
| 111 | + - name: Inject cargo cache into docker |
| 112 | + uses: reproducible-containers/buildkit-cache-dance@3 |
| 113 | + with: |
| 114 | + cache-map: | |
| 115 | + { |
| 116 | + "../cargo-cache-registry-index": { |
| 117 | + "target": "/root/.cargo/registry/index", |
| 118 | + "id": "cargo_registry_index" |
| 119 | + }, |
| 120 | + "../cargo-cache-registry-cache": { |
| 121 | + "target": "/root/.cargo/registry/cache", |
| 122 | + "id": "cargo_registry_index" |
| 123 | + }, |
| 124 | + "../cargo-cache-git-db": { |
| 125 | + "target": "/root/.cargo/git/db", |
| 126 | + "id": "cargo_registry_index" |
| 127 | + }, |
| 128 | + } |
| 129 | + skip-extraction: ${{ steps.cargo-cache.outputs.cache-hit }} |
| 130 | + |
| 131 | + - name: Yarn unplugged cache for Docker |
| 132 | + uses: actions/cache@v4 |
| 133 | + id: yarn-cache |
| 134 | + with: |
| 135 | + path: ../yarn-unplugged-cache |
| 136 | + key: ${{ runner.os }}-yarn-unplugged-amd64-${{ hashFiles('yarn.lock') }} |
| 137 | + restore-keys: |
| 138 | + - ${{ runner.os }}-yarn-unplugged-amd64- |
| 139 | + |
| 140 | + - name: Inject cargo cache into docker |
| 141 | + uses: reproducible-containers/buildkit-cache-dance@3 |
| 142 | + with: |
| 143 | + cache-map: | |
| 144 | + { |
| 145 | + "../yarn-unplugged-cache": { |
| 146 | + "target": "/tmp/unplugged", |
| 147 | + "id": "unplugged_amd64" |
| 148 | + }, |
| 149 | + } |
| 150 | + skip-extraction: ${{ steps.yarn-cache.outputs.cache-hit }} |
| 151 | + |
95 | 152 | - name: Build and push Docker image ${{ inputs.image }} |
96 | 153 | id: docker_build |
97 | 154 | uses: docker/build-push-action@v6 |
|
0 commit comments