Skip to content

Merge pull request #44 from butaneprotocol/minswap-v2 #74

Merge pull request #44 from butaneprotocol/minswap-v2

Merge pull request #44 from butaneprotocol/minswap-v2 #74

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 }}