Skip to content

Commit f4278c2

Browse files
committed
chore: fix deployment (2)
1 parent ba140f6 commit f4278c2

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

.github/workflows/build-and-release.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,20 @@ jobs:
7373
tags: |
7474
coderblvck/kpeek:latest
7575
coderblvck/kpeek:${{ steps.bump_version.outputs.new_tag }}
76+
build-args: |
77+
KPEEK_VERSION=${{ steps.bump_version.outputs.new_tag }}
7678
cache-from: type=registry,ref=coderblvck/kpeek:buildcache
7779
cache-to: type=registry,ref=coderblvck/kpeek:buildcache,mode=max
7880
secrets: |
7981
GIT_AUTH_TOKEN=${{ secrets.ACCESS_TOKEN }}
8082
83+
# Upload the built binary as an artifact
84+
- name: Upload kpeek binary
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: kpeek-binary
88+
path: kpeek
89+
8190
# Create GitHub Release.
8291
- name: Create GitHub Release
8392
if: ${{ success() }}

Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
# Dockerfile
2+
FROM golang:1.24-alpine AS builder
3+
WORKDIR /app
4+
COPY go.mod go.sum ./
5+
RUN go mod download
6+
COPY . .
7+
RUN go build -ldflags "-X github.com/hacktivist123/kpeek/cmd.version=${KPEEK_VERSION}" -o kpeek .
8+
29
FROM alpine:3.18
3-
COPY kpeek /usr/local/bin/kpeek
10+
WORKDIR /app
11+
COPY --from=builder /app/kpeek /usr/local/bin/kpeek
412
ENTRYPOINT ["kpeek"]

0 commit comments

Comments
 (0)