Skip to content

Commit bbd125f

Browse files
committed
Add Docker build workflow to publish images to GHCR
Adds a GitHub Actions workflow that builds and pushes Docker images to ghcr.io/kuberik/github-controller when version tags are pushed. This ensures the install manifests published by the release workflow reference images that actually exist in the registry.
1 parent e869b9a commit bbd125f

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

.github/workflows/docker-build.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Docker Build and Push
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
jobs:
9+
docker:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Docker Buildx
19+
uses: docker/setup-buildx-action@v3
20+
21+
- name: Log in to GitHub Container Registry
22+
uses: docker/login-action@v3
23+
with:
24+
registry: ghcr.io
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Extract version from tag
29+
id: meta
30+
run: |
31+
VERSION=${GITHUB_REF#refs/tags/}
32+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
33+
echo "Building version: ${VERSION}"
34+
35+
- name: Build and push Docker image
36+
uses: docker/build-push-action@v5
37+
with:
38+
context: .
39+
push: true
40+
tags: ghcr.io/kuberik/github-controller:${{ steps.meta.outputs.version }}
41+
platforms: linux/amd64,linux/arm64
42+
cache-from: type=gha
43+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)