Skip to content

TEMP run docker on branch #99

TEMP run docker on branch

TEMP run docker on branch #99

name: Build Docker Image
# This job builds the docker image, to refresh docker's caches.
# It does not publish the new image.
on:
push
jobs:
build_image:
name: Build Docker image
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: "ubuntu-22.04"
platform: linux/amd64
rust_target: x86_64-unknown-linux-gnu
- os: "ubuntu-22.04"
platform: linux/arm64
rust_target: aarch64-unknown-linux-gnu
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: Install ARM toolchain
if: matrix.rust_target == 'aarch64-unknown-linux-gnu'
run: |
rustup target install aarch64-unknown-linux-gnu
sudo apt install gcc-aarch64-linux-gnu
- name: Rust Cache
id: cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ matrix.rust_target }}
- name: Compile
run: cargo build --release --target ${{ matrix.rust_target }}
- 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: ./prebuilt.Dockerfile
outputs: type=image
platforms: ${{ matrix.platform }}
build-args: |
RUST_TARGET=${{ matrix.rust_target }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}