Skip to content

Commit 3f166d3

Browse files
hallelx2claude
andcommitted
ci: publish Docker image to ghcr.io on push to main + tags
Adds a docker-publish workflow that builds the engine image and pushes it to ghcr.io/hallelx2/vectorless-engine on every push to main and every vX.Y.Z tag. Uses Buildx with GitHub Actions cache so subsequent builds reuse layers. Tag matrix: main — latest main branch sha-<7chars> — immutable per-commit vX.Y.Z — release tags latest — release tags only Anyone can `docker pull ghcr.io/hallelx2/vectorless-engine:main` and get a working engine binary without cloning the repo or installing Go. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4384cb3 commit 3f166d3

1 file changed

Lines changed: 70 additions & 0 deletions

File tree

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: docker-publish
2+
3+
# Build and publish the engine Docker image to GitHub Container Registry
4+
# on every push to main and every semver tag (vX.Y.Z).
5+
#
6+
# Resulting tags:
7+
# ghcr.io/hallelx2/vectorless-engine:main (latest main branch)
8+
# ghcr.io/hallelx2/vectorless-engine:sha-<7chars> (immutable, per-commit)
9+
# ghcr.io/hallelx2/vectorless-engine:vX.Y.Z (release tags)
10+
# ghcr.io/hallelx2/vectorless-engine:latest (only on release tags)
11+
12+
on:
13+
push:
14+
branches: [main]
15+
tags: ["v*.*.*"]
16+
17+
permissions:
18+
contents: read
19+
packages: write # required to push to ghcr.io
20+
21+
jobs:
22+
publish:
23+
name: build + push (${{ matrix.platform }})
24+
runs-on: ubuntu-latest
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
platform: [linux/amd64] # add linux/arm64 once you're ready to spend the build time
29+
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
34+
- name: Set up QEMU
35+
uses: docker/setup-qemu-action@v3
36+
37+
- name: Set up Docker Buildx
38+
uses: docker/setup-buildx-action@v3
39+
40+
- name: Log in to ghcr.io
41+
uses: docker/login-action@v3
42+
with:
43+
registry: ghcr.io
44+
username: ${{ github.actor }}
45+
password: ${{ secrets.GITHUB_TOKEN }}
46+
47+
- name: Extract tags + labels
48+
id: meta
49+
uses: docker/metadata-action@v5
50+
with:
51+
images: ghcr.io/${{ github.repository_owner }}/vectorless-engine
52+
tags: |
53+
type=ref,event=branch
54+
type=ref,event=tag
55+
type=sha,prefix=sha-,format=short
56+
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
57+
58+
- name: Build + push
59+
uses: docker/build-push-action@v6
60+
with:
61+
context: .
62+
file: ./Dockerfile
63+
platforms: ${{ matrix.platform }}
64+
push: true
65+
tags: ${{ steps.meta.outputs.tags }}
66+
labels: ${{ steps.meta.outputs.labels }}
67+
build-args: |
68+
VERSION=${{ github.ref_name }}
69+
cache-from: type=gha
70+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)