-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (55 loc) · 1.79 KB
/
refresh-docker-cache.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Build Docker Image
# This job builds the docker image, to refresh docker's caches.
# It does not publish the new image.
on:
push:
branches:
- main
jobs:
build_image:
name: Build Docker image
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@5138f76647652447004da686b2411557eaf65f33
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: sundaeswap/butane-oracle
- name: Cargo Cache
id: cache
uses: actions/cache@v4
with:
path: |
cargo-registry-cache
sccache-cache
key: ${{ runner.os }}-cargo-cache-${{ github.sha }}
restore-keys: |
${{ runner.os }}-cargo-cache
- name: inject cargo caches into docker
uses: reproducible-containers/buildkit-cache-dance@5b6db76d1da5c8b307d5d2e0706d266521b710de # v3.1.2
with:
cache-map: |
{
"cargo-registry-cache": "/usr/local/cargo/registry",
"sccache-cache": "/sccache"
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
- name: Build Docker image
id: build
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
file: ./Dockerfile
outputs: type=image
platforms: "linux/amd64,linux/arm64"
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}