Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 34 additions & 19 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
name: Build and Push Docker Image
name: Release

on:
push:
branches:
- main
tags:
- 'v*'

permissions:
contents: read
contents: write
packages: write

jobs:
build-and-push:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -28,24 +26,41 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/kubeorch/core
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,prefix=
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Build and push
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
tags: |
ghcr.io/kubeorch/core:latest
ghcr.io/kubeorch/core:${{ steps.version.outputs.VERSION }}
labels: |
org.opencontainers.image.title=KubeOrch Core
org.opencontainers.image.version=${{ steps.version.outputs.VERSION }}
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64
platforms: linux/amd64

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.VERSION }}
name: ${{ steps.version.outputs.VERSION }}
generate_release_notes: true
body: |
## Docker Image

```bash
docker pull ghcr.io/kubeorch/core:${{ steps.version.outputs.VERSION }}
```

Run with `orchcli`:
```bash
orchcli init && orchcli start -d
```
8 changes: 2 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
# Stage 1: Builder
FROM golang:1.25-alpine AS builder

# Build args for multi-platform support
ARG TARGETOS=linux
ARG TARGETARCH=amd64

# Install git and ca-certificates for fetching dependencies
RUN apk add --no-cache git ca-certificates

Expand All @@ -22,8 +18,8 @@ RUN go mod download
# Copy source code
COPY . .

# Build the application for the target platform
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \
# Build the application
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
-ldflags="-w -s" \
-o kubeorch-core \
.
Expand Down