fix(ci): authenticate private module builds
This commit is contained in:
@@ -52,6 +52,8 @@ jobs:
|
|||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
push: true
|
push: true
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
|
secrets: |
|
||||||
|
gitea_credentials=${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}
|
||||||
tags: |
|
tags: |
|
||||||
${{ env.REGISTRY_HOST }}/${{ env.IMAGE_NAME }}:latest
|
${{ env.REGISTRY_HOST }}/${{ env.IMAGE_NAME }}:latest
|
||||||
${{ env.REGISTRY_HOST }}/${{ env.IMAGE_NAME }}:${{ steps.image.outputs.sha_short }}
|
${{ env.REGISTRY_HOST }}/${{ env.IMAGE_NAME }}:${{ steps.image.outputs.sha_short }}
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
|
# syntax=docker/dockerfile:1.7
|
||||||
FROM golang:1.24-alpine AS build
|
FROM golang:1.24-alpine AS build
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY go.mod ./
|
RUN apk add --no-cache git
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN --mount=type=secret,id=gitea_credentials \
|
||||||
|
credentials="$(cat /run/secrets/gitea_credentials)" && \
|
||||||
|
git config --global url."https://${credentials}@cloud.campbellwireless.net/git/".insteadOf "https://cloud.campbellwireless.net/git/" && \
|
||||||
|
GOPRIVATE=cloud.campbellwireless.net go mod download && \
|
||||||
|
git config --global --unset-all url."https://${credentials}@cloud.campbellwireless.net/git/".insteadOf
|
||||||
COPY cmd ./cmd
|
COPY cmd ./cmd
|
||||||
COPY internal ./internal
|
COPY internal ./internal
|
||||||
RUN CGO_ENABLED=0 go build -trimpath -ldflags='-s -w' -o /pawsql ./cmd/pawsql
|
RUN CGO_ENABLED=0 go build -trimpath -ldflags='-s -w' -o /pawsql ./cmd/pawsql
|
||||||
|
|||||||
Reference in New Issue
Block a user