Skip to content

Commit

Permalink
indexer: add GIT_HASH as docker build argument
Browse files Browse the repository at this point in the history
  • Loading branch information
ptisserand committed Mar 28, 2024
1 parent 57ca922 commit c04c982
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/indexer.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Indexer
name: Bridge Indexer

on:
workflow_dispatch:
push:
paths: "apps/indexer/**"
workflow_dispatch:

jobs:
build-and-push:
Expand All @@ -29,5 +29,7 @@ jobs:
uses: docker/build-push-action@v4
with:
push: true
file: apps/indexer/Dockerfile
tags: ghcr.io/${{ github.repository }}:latest
context: apps/indexer
tags: ghcr.io/${{ github.repository }}:latest
build-args: |
"GIT_HASH=$GITHUB_SHA"
6 changes: 5 additions & 1 deletion apps/indexer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 .

Expand Down

0 comments on commit c04c982

Please sign in to comment.