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 .