Skip to content

Commit 1f42000

Browse files
author
anton.voskresensky
committed
fix api
1 parent a95a044 commit 1f42000

16 files changed

Lines changed: 1012 additions & 889 deletions

File tree

.github/workflows/release.yaml

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,49 @@
1-
name: release
1+
name: Docker Image
22

33
on:
44
push:
55
tags:
66
- '**'
7-
branches:
8-
- 'develop'
97

108
jobs:
9+
1110
build:
1211
runs-on: ubuntu-latest
12+
1313
steps:
14-
- name: Check out repo
15-
uses: actions/checkout@v2
16-
with:
17-
fetch-depth: 0
18-
19-
- name: Docker meta
20-
id: meta
21-
uses: docker/metadata-action@v3
22-
with:
23-
images: ghcr.io/${{ github.repository_owner }}/cert-manager-webhook-nicru
24-
tags: |
25-
type=schedule
26-
type=ref,event=branch
27-
type=ref,event=pr
28-
type=semver,pattern={{version}}
29-
type=semver,pattern={{major}}.{{minor}}
30-
type=semver,pattern={{major}}
31-
type=sha
32-
33-
- name: Set up Docker buildx
34-
uses: docker/setup-buildx-action@v1
35-
36-
- name: Login to Github Packages
37-
uses: docker/login-action@v1
38-
with:
39-
registry: ghcr.io
40-
username: ${{ github.repository_owner }}
41-
password: ${{ secrets.GITHUB_TOKEN }}
42-
43-
- name: Build and push
44-
uses: docker/build-push-action@v2
45-
with:
46-
context: .
47-
push: true
48-
tags: ${{ steps.meta.outputs.tags }}
14+
- uses: actions/checkout@v4
15+
16+
- name: Docker meta
17+
id: meta
18+
uses: docker/metadata-action@v5
19+
with:
20+
images: ghcr.io/${{ github.repository }}
21+
tags: |
22+
type=schedule
23+
type=ref,event=branch
24+
type=ref,event=pr
25+
type=semver,pattern={{version}}
26+
type=semver,pattern={{major}}.{{minor}}
27+
type=semver,pattern={{major}}
28+
type=sha
29+
30+
- name: Set up Docker Buildx
31+
id: buildx
32+
uses: docker/setup-buildx-action@v3
33+
34+
- name: Login to Github Packages
35+
uses: docker/login-action@v3
36+
with:
37+
registry: ghcr.io
38+
username: ${{ github.repository_owner }}
39+
password: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Build and push
42+
uses: docker/build-push-action@v5
43+
with:
44+
context: .
45+
build-args: |
46+
versionflags=-X 'main.appVersion=${{ github.ref_name }}'
47+
push: ${{ github.event_name != 'pull_request' }}
48+
tags: ${{ steps.meta.outputs.tags }}
49+
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
FROM golang:1.22.3-alpine AS build
1+
FROM golang:1.25-alpine AS build
22
RUN apk add --no-cache git
33
WORKDIR /src
4-
ENV GO111MODULE=on
5-
COPY . .
4+
ARG versionflags=""
5+
COPY go.mod go.sum ./
66
RUN go mod download
7-
RUN CGO_ENABLED=0 go build -o webhook -ldflags '-w -extldflags "-static"' .
7+
COPY . .
8+
RUN CGO_ENABLED=0 go build -o webhook -ldflags "-w -s -extldflags '-static' ${versionflags}" .
89

9-
# ------------------------------
10-
FROM alpine:3.14.2
10+
FROM alpine:3.21
1111
RUN apk add --no-cache ca-certificates
1212
COPY --from=build /src/webhook /usr/local/bin/webhook
13-
ENTRYPOINT ["webhook"]
13+
ENTRYPOINT ["webhook"]

LICENSE

Lines changed: 0 additions & 201 deletions
This file was deleted.

0 commit comments

Comments
 (0)