diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index aaf2f7c..a9583fb 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -5,7 +5,8 @@ on: tags: - "v*" branches: - - "block_any" + - "develop" + - "stepdtest" workflow_dispatch: env: @@ -37,11 +38,11 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Get repo name - id: extract_repo_name + - name: Get go pseudohash + id: extract_pseudohash shell: bash run: | - echo "REPO_NAME=$(basename ${{ github.repository }})" >> $GITHUB_ENV + echo "GO_PSEUDOHASH=$(go list -f '{{.Version}}' -m github.com/streamingfast/firehose-core@${{ github.sha }})" > $GITHUB_ENV - name: Generate docker tags/labels from github build context id: meta @@ -51,6 +52,7 @@ jobs: tags: | type=ref,event=tag type=sha,prefix=,enable=true + type=raw,value=${{ env.GO_PSEUDOHASH }} type=raw,enable=${{ github.ref == 'refs/heads/develop' }},value=develop flavor: | latest=${{ startsWith(github.ref, 'refs/tags/') }} @@ -59,6 +61,8 @@ jobs: uses: docker/build-push-action@v4 with: context: . + build-args: | + VERSION=${{ github.event.ref }} push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} @@ -75,4 +79,4 @@ jobs: uses: Ilshidur/action-slack@2.0.2 with: args: | - :done: *${{ github.repository }}* Success building docker image from ${{ github.ref_type }} _${{ github.ref_name }}_ (${{ github.actor }}) :sparkling_heart: ```${{ join(needs.build.outputs.tags, ' ') }}``` \ No newline at end of file + :done: *${{ github.repository }}* Success building docker image from ${{ github.ref_type }} _${{ github.ref_name }}_ (${{ github.actor }}) :sparkling_heart: ```${{ join(needs.build.outputs.tags, ' ') }}``` diff --git a/Dockerfile b/Dockerfile index 83bf5ef..c8bab70 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN go mod download COPY . ./ -RUN go build ./cmd/firecore +RUN go build -v -ldflags "-X main.version=${VERSION}" ./cmd/firecore #### @@ -23,4 +23,4 @@ WORKDIR /app COPY --from=build /app/firecore /app/firecore -ENTRYPOINT [ "/app/firecore" ] \ No newline at end of file +ENTRYPOINT [ "/app/firecore" ] diff --git a/firecore b/firecore new file mode 100755 index 0000000..e9e68e8 Binary files /dev/null and b/firecore differ