add docker builds
This commit is contained in:
parent
ba9e9ab9ab
commit
d0126c97ff
4 changed files with 51 additions and 2 deletions
32
.woodpecker/docker.yaml
Normal file
32
.woodpecker/docker.yaml
Normal file
|
@ -0,0 +1,32 @@
|
|||
steps:
|
||||
- name: publish_image
|
||||
image: woodpeckerci/plugin-docker-buildx
|
||||
settings:
|
||||
repo: git.gnous.eu/${CI_REPO_OWNER}/forgejo
|
||||
dockerfile: Dockerfile
|
||||
platforms: linux/amd64
|
||||
registry: https://git.gnous.eu
|
||||
tag: ${CI_COMMIT}
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
when:
|
||||
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||
event: push
|
||||
- name: publish_image_tag
|
||||
image: woodpeckerci/plugin-docker-buildx
|
||||
settings:
|
||||
repo: git.gnous.eu/${CI_REPO_OWNER}/forgejo
|
||||
dockerfile: Dockerfile
|
||||
platforms: linux/amd64
|
||||
registry: https://git.gnous.eu
|
||||
tags:
|
||||
- ${CI_COMMIT_TAG##v} # Remove v from tag
|
||||
- stable
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
when:
|
||||
event: tag
|
|
@ -1,6 +1,6 @@
|
|||
steps:
|
||||
lint:
|
||||
image: golang:1.22
|
||||
image: golang:1.24
|
||||
commands:
|
||||
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
||||
- golangci-lint run
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
steps:
|
||||
- name: Build
|
||||
image: golang:1.22
|
||||
image: golang:1.24
|
||||
commands:
|
||||
- go mod download
|
||||
- go get
|
||||
|
|
17
Dockerfile
Normal file
17
Dockerfile
Normal file
|
@ -0,0 +1,17 @@
|
|||
FROM golang:1.24 AS builder
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
ARG BUILDPLATFORM
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
|
||||
WORKDIR /app/
|
||||
ADD . .
|
||||
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-w -s" -o epee main.go
|
||||
|
||||
FROM scratch
|
||||
WORKDIR /app/
|
||||
COPY --from=builder /app/epee /app/epee
|
||||
|
||||
EXPOSE 5900
|
||||
ENTRYPOINT ["/app/epee"]
|
Loading…
Add table
Add a link
Reference in a new issue