Compare commits
3 Commits
25bc095412
...
v1.0.2
| Author | SHA1 | Date | |
|---|---|---|---|
| dd8dd7cdc2 | |||
| fc54f7bb86 | |||
| 42030003d3 |
46
.gitea/workflows/publish.yml
Normal file
46
.gitea/workflows/publish.yml
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
name: Build and Publish Docker Image
|
||||||
|
run-name: Publishing ${{ gitea.ref_name }}
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version-file: go.mod
|
||||||
|
cache: false
|
||||||
|
|
||||||
|
- name: Run Tests
|
||||||
|
run: go test ./...
|
||||||
|
|
||||||
|
- name: Install Docker
|
||||||
|
run: curl -fsSL https://get.docker.com | sh
|
||||||
|
|
||||||
|
- name: Build Docker Image
|
||||||
|
run: |
|
||||||
|
docker build \
|
||||||
|
--build-arg APP_VERSION=${{ gitea.ref_name }} \
|
||||||
|
-t tea.chunkbyte.com/kato/warpbox:${{ gitea.ref_name }} \
|
||||||
|
-t tea.chunkbyte.com/kato/warpbox:latest \
|
||||||
|
.
|
||||||
|
|
||||||
|
- name: Login to Gitea Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: tea.chunkbyte.com
|
||||||
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Push Docker Image
|
||||||
|
run: |
|
||||||
|
docker push tea.chunkbyte.com/kato/warpbox:${{ gitea.ref_name }}
|
||||||
|
docker push tea.chunkbyte.com/kato/warpbox:latest
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
# Stage 1: Build
|
# Stage 1: Build
|
||||||
FROM golang:1.23-alpine AS builder
|
FROM golang:1.23-alpine AS builder
|
||||||
|
|
||||||
|
ARG APP_VERSION=""
|
||||||
|
|
||||||
RUN apk add --no-cache git ca-certificates
|
RUN apk add --no-cache git ca-certificates
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
@@ -21,6 +23,9 @@ RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o warpbox ./cmd/
|
|||||||
# Stage 2: Runtime
|
# Stage 2: Runtime
|
||||||
FROM alpine:3.21
|
FROM alpine:3.21
|
||||||
|
|
||||||
|
ARG APP_VERSION=""
|
||||||
|
ENV APP_VERSION=${APP_VERSION}
|
||||||
|
|
||||||
RUN apk add \
|
RUN apk add \
|
||||||
--no-cache \
|
--no-cache \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
|
|||||||
Reference in New Issue
Block a user