From c04c98267cde4a5af33ce0eef0d06cf688975475 Mon Sep 17 00:00:00 2001 From: Patrice Tisserand Date: Thu, 28 Mar 2024 13:55:52 +0100 Subject: [PATCH] indexer: add GIT_HASH as docker build argument --- .github/workflows/indexer.yml | 10 ++++++---- apps/indexer/Dockerfile | 6 +++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/indexer.yml b/.github/workflows/indexer.yml index aedf7588..b9c1f81a 100644 --- a/.github/workflows/indexer.yml +++ b/.github/workflows/indexer.yml @@ -1,9 +1,9 @@ -name: Indexer +name: Bridge Indexer on: - workflow_dispatch: push: paths: "apps/indexer/**" + workflow_dispatch: jobs: build-and-push: @@ -29,5 +29,7 @@ jobs: uses: docker/build-push-action@v4 with: push: true - file: apps/indexer/Dockerfile - tags: ghcr.io/${{ github.repository }}:latest \ No newline at end of file + context: apps/indexer + tags: ghcr.io/${{ github.repository }}:latest + build-args: | + "GIT_HASH=$GITHUB_SHA" \ No newline at end of file diff --git a/apps/indexer/Dockerfile b/apps/indexer/Dockerfile index 79a16cad..5ce644c2 100644 --- a/apps/indexer/Dockerfile +++ b/apps/indexer/Dockerfile @@ -1,12 +1,16 @@ FROM rust:1.75.0-bookworm AS builder +ARG GIT_HASH +ENV GIT_HASH ${GIT_HASH} + WORKDIR /usr/src/myapp COPY Starklane_ABI.json . COPY Cargo.toml Cargo.toml COPY Cargo.lock Cargo.lock COPY src src -COPY git-version git-version +# COPY doesn't check if file is present when matching is used +COPY git-versio[n] git-version RUN cargo install --path .