mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
fix(build): actions docker build-args (#165)
* fix(build): actions docker build-args
This commit is contained in:
parent
0878790232
commit
1374dd150c
2 changed files with 8 additions and 7 deletions
5
.github/workflows/docker.yml
vendored
5
.github/workflows/docker.yml
vendored
|
@ -44,8 +44,9 @@ jobs:
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
build-args: |
|
build-args: |
|
||||||
GIT_TAG=$GITHUB_REF_NAME
|
BUILDTIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
|
||||||
GIT_COMMIT=$GITHUB_SHA
|
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
|
||||||
|
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
|
||||||
|
|
||||||
- name: Image digest
|
- name: Image digest
|
||||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||||
|
|
10
Dockerfile
10
Dockerfile
|
@ -9,9 +9,9 @@ RUN yarn build
|
||||||
# build app
|
# build app
|
||||||
FROM golang:1.17.6-alpine AS app-builder
|
FROM golang:1.17.6-alpine AS app-builder
|
||||||
|
|
||||||
ARG GIT_TAG=dev
|
ARG VERSION=dev
|
||||||
ARG GIT_COMMIT=dev
|
ARG REVISION=dev
|
||||||
ARG DATETIME
|
ARG BUILDTIME
|
||||||
|
|
||||||
RUN apk add --no-cache git make build-base
|
RUN apk add --no-cache git make build-base
|
||||||
|
|
||||||
|
@ -30,8 +30,8 @@ COPY --from=web-builder /web/build.go ./web
|
||||||
ENV GOOS=linux
|
ENV GOOS=linux
|
||||||
ENV CGO_ENABLED=1
|
ENV CGO_ENABLED=1
|
||||||
|
|
||||||
RUN go build -ldflags "-s -w -X main.version=${GIT_TAG} -X main.commit=${GIT_COMMIT} -X main.date=${DATETIME}" -o bin/autobrr cmd/autobrr/main.go
|
RUN go build -ldflags "-s -w -X main.version=${VERSION} -X main.commit=${REVISION} -X main.date=${BUILDTIME}" -o bin/autobrr cmd/autobrr/main.go
|
||||||
RUN go build -ldflags "-s -w -X main.version=${GIT_TAG} -X main.commit=${GIT_COMMIT} -X main.date=${DATETIME}" -o bin/autobrrctl cmd/autobrrctl/main.go
|
RUN go build -ldflags "-s -w -X main.version=${VERSION} -X main.commit=${REVISION} -X main.date=${BUILDTIME}" -o bin/autobrrctl cmd/autobrrctl/main.go
|
||||||
|
|
||||||
# build runner
|
# build runner
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue