Skip to content

Commit

Permalink
add build-code
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Fudeus committed May 19, 2024
1 parent 3f531e5 commit 8cd6525
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/docker-build-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Docker Build/Publish Release
on:
push:
branches:
- "build"
workflow_dispatch: {}

jobs:
build:
uses: sfudeus/workflows/.github/workflows/docker-build-publish-branch.yaml@main
secrets: inherit
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ARG GO_VERSION=1.22
FROM golang:${GO_VERSION} AS builder

WORKDIR /build
#ADD . /build

ENV CGO_ENABLED=0
#RUN go build -o /build/apcupsd_exporter /build/cmd/apcupsd_exporter/main.go
RUN go get -u github.com/mdlayher/apcupsd_exporter
RUN go build -o /build/apcupsd_exporter $GOPATH/src/github.com/mdlayher/apcupsd_exporter/cmd/apcupsd_exporter/main.go

FROM scratch
COPY --from=builder /build/apcupsd_exporter /apcupsd_exporter
LABEL maintainer="Stephan Fudeus <github@mails.fudeus.net>"

ENTRYPOINT ["/apcupsd_exporter"]
EXPOSE 9162

0 comments on commit 8cd6525

Please sign in to comment.