Skip to content

Commit a710cb1

Browse files
klakeggclaude
andcommitted
chore: add GitHub Actions CI/CD workflow
Add comprehensive GitHub Actions workflow for automated builds and Docker image publishing: - Build and test on push/PR to main branch - Multi-platform Docker builds (linux/amd64, linux/arm64) - Push edge images on every commit to main - Push versioned and latest tags on release 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 61b6a31 commit a710cb1

2 files changed

Lines changed: 84 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
release:
9+
types: [ released ]
10+
11+
jobs:
12+
build:
13+
name: Build [JVM]
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v6
19+
20+
- name: Setup Go
21+
uses: actions/setup-go@v6
22+
with:
23+
go-version-file: 'go.mod'
24+
25+
- name: Build
26+
run: make build
27+
28+
- name: Test
29+
run: make test
30+
31+
docker-jvm:
32+
name: Docker
33+
runs-on: ubuntu-latest
34+
needs:
35+
- build
36+
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v6
40+
41+
- name: Prepare version labels
42+
uses: k15g/action-version-labels@edge
43+
with:
44+
prefix: project
45+
46+
- name: Login to GitHub Container Registry
47+
uses: docker/login-action@v3
48+
with:
49+
registry: ghcr.io
50+
username: ${{ github.actor }}
51+
password: ${{ secrets.GITHUB_TOKEN }}
52+
53+
- name: Set up QEMU
54+
uses: docker/setup-qemu-action@v3
55+
56+
- name: Set up Docker Buildx
57+
uses: docker/setup-buildx-action@v3
58+
59+
- name: Lowercase github.repository
60+
run: echo "IMAGE_NAME=`echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]'`" >>${GITHUB_ENV}
61+
62+
- name: Build and push [edge]
63+
run: |
64+
docker buildx build \
65+
-t ghcr.io/${{ env.IMAGE_NAME }}:edge \
66+
--platform linux/amd64,linux/arm64 \
67+
--push .
68+
69+
- name: Build and push [version]
70+
if: startsWith(github.ref, 'refs/tags/v')
71+
run: |
72+
docker buildx build \
73+
-t ghcr.io/${{ env.IMAGE_NAME }}:${{ env.PROJECT_VERSION }} \
74+
--platform linux/amd64,linux/arm64 \
75+
--push .
76+
77+
- name: Build and push [latest]
78+
if: startsWith(github.ref, 'refs/tags/v')
79+
run: |
80+
docker buildx build \
81+
-t ghcr.io/${{ env.IMAGE_NAME }}:latest \
82+
--platform linux/amd64,linux/arm64 \
83+
--push .

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ COPY . .
1313
# Build the application
1414
RUN CGO_ENABLED=0 GOOS=linux go build -o /indexer ./cmd/indexer
1515

16+
1617
# Final stage
1718
FROM alpine:3.23
1819

0 commit comments

Comments
 (0)