Skip to content

Commit

Permalink
ci: build image
Browse files Browse the repository at this point in the history
  • Loading branch information
incubator4 committed Mar 1, 2024
1 parent 4dda176 commit 347db04
Show file tree
Hide file tree
Showing 7 changed files with 317 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
target-branch: "main"
16 changes: 16 additions & 0 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Build and Deploy
on:
push:
branches:
- main
tags:
- v*
jobs:
build:
uses: NaturalSelectionLabs/Daedalus/.github/workflows/docker-tpl.yaml@main
with:
images: rss3/geth-exporter
context: .
dockerfile: ./Dockerfile
platforms: linux/amd64,linux/arm64
secrets: inherit
21 changes: 21 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Lint
on:
push:
branches:
- main

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: "1.21"
- name: Checkout
uses: actions/checkout@v3
- name: GolangCI Lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.55.2
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM rss3/go-builder as base

WORKDIR /app

RUN --mount=type=cache,target=/go/pkg/mod/ \
--mount=type=bind,source=go.sum,target=go.sum \
--mount=type=bind,source=go.mod,target=go.mod \
go mod download -x

COPY . .

FROM base AS builder

ENV CGO_ENABLED=0
RUN --mount=type=cache,target=/go/pkg/mod/ \
go build cmd/main.go

FROM rss3/go-runtime AS runner


COPY --from=builder /root/gi/main /bin/geth-exporter

EXPOSE 8000
USER nobody
ENTRYPOINT ["/bin/geth-exporter"]
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/naturalselectionlabs/geth-exporter

go 1.22.0
go 1.21.4

require (
github.com/ethereum/go-ethereum v1.13.14
Expand Down
215 changes: 215 additions & 0 deletions go.sum

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
run:
timeout: 10m

linters:
enable:
# Enabled by default
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused
# Disabled by default
- asasalint
- asciicheck
- bodyclose
- errorlint
- gci
- gocyclo
- gosec
- makezero
- noctx
- paralleltest
- prealloc
- reassign
- revive
- whitespace
- wsl

issues:
max-issues-per-linter: 0 # Unlimited
max-same-issues: 0 # Unlimited

0 comments on commit 347db04

Please sign in to comment.