Skip to content

Commit

Permalink
build(ci): fix multiple build-args for release job
Browse files Browse the repository at this point in the history
  • Loading branch information
dwisiswant0 committed Oct 6, 2023
1 parent 1b0b79f commit b474795
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/release-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,7 @@ jobs:
- uses: docker/[email protected]
with:
push: true
build-args: "VERSION=${{ inputs.tag || github.ref_name }},PGO_FILE=${{ github.workspace }}/default.pgo"
build-args: |
VERSION=${{ inputs.tag || github.ref_name }}
PGO_FILE=${{ github.workspace }}/default.pgo
tags: "ghcr.io/${{ github.repository }}:latest,ghcr.io/${{ github.repository }}:${{ inputs.tag || github.ref_name }}"
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19-alpine AS build
FROM golang:alpine AS build

ARG VERSION="docker"
ARG LDFLAGS="-s -w -X github.com/kitabisa/teler-proxy/common.Version=${VERSION}"
Expand All @@ -9,13 +9,14 @@ LABEL repository="https://github.com/kitabisa/teler-proxy"
LABEL maintainer="dwisiswant0"

WORKDIR /app
COPY ./go.mod .
COPY go.mod default.pgo .
RUN go mod download

RUN apk add build-base

COPY . .
RUN CGO_ENABLED="1" go build -pgo "${PGO_FILE}" -ldflags "${LDFLAGS}" \
RUN CGO_ENABLED="1" go build \
-pgo "${PGO_FILE}" -ldflags "${LDFLAGS}" \
-o ./bin/teler-proxy ./cmd/teler-proxy

FROM alpine:latest
Expand Down

0 comments on commit b474795

Please sign in to comment.