Skip to content

Commit bdee90f

Browse files
committed
initial
0 parents  commit bdee90f

19 files changed

Lines changed: 1303 additions & 0 deletions

File tree

.dockerignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Git and GitHub
2+
.git
3+
.github
4+
.gitignore
5+
.dockerignore
6+
7+
# Build and CI artifacts
8+
*.test
9+
*.out
10+
*.prof
11+
*.json
12+
*.txt
13+
Makefile
14+
docker-compose.yml
15+
16+
# Documentation
17+
README.md
18+
LICENSE
19+
20+
# Source code that shouldn't be in the runtime image
21+
* _test.go
22+
docs/
23+
24+
# IDE files
25+
.vscode
26+
.idea

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
workflow_call:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
ci:
11+
name: CI
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v5
16+
17+
- uses: actions/setup-go@v6
18+
with:
19+
go-version: 1.25
20+
21+
- name: Test
22+
run: go test -v ./...
23+
24+
- name: Lint
25+
uses: golangci/golangci-lint-action@v9
26+
with:
27+
version: v2.7

.github/workflows/release.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
packages: write
11+
id-token: write
12+
13+
jobs:
14+
ci:
15+
uses: ./.github/workflows/ci.yml
16+
secrets: inherit
17+
18+
build-and-publish:
19+
name: Build, Sign and Publish
20+
needs: ci
21+
runs-on: ubuntu-latest
22+
env:
23+
REGISTRY: ghcr.io
24+
IMAGE_NAME: ${{ github.repository }}
25+
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v5
29+
30+
- name: Install Cosign
31+
uses: sigstore/cosign-installer@v3.7.0
32+
33+
- name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v3
35+
36+
- name: Log in to Docker registry
37+
uses: docker/login-action@v3
38+
with:
39+
registry: dhi.io
40+
username: ${{ secrets.DHI_USERNAME }}
41+
password: ${{ secrets.DHI_TOKEN }}
42+
43+
- name: Log in to GitHub registry
44+
uses: docker/login-action@v3
45+
with:
46+
registry: ${{ env.REGISTRY }}
47+
username: ${{ github.actor }}
48+
password: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Extract Docker metadata
51+
id: meta
52+
uses: docker/metadata-action@v5
53+
with:
54+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
55+
tags: |
56+
type=raw,value=latest,enable={{is_default_branch}}
57+
type=sha,format=long
58+
59+
- name: Build and push Docker image
60+
id: build-and-push
61+
uses: docker/build-push-action@v6
62+
with:
63+
context: .
64+
push: true
65+
tags: ${{ steps.meta.outputs.tags }}
66+
labels: ${{ steps.meta.outputs.labels }}
67+
cache-from: type=gha
68+
cache-to: type=gha,mode=max
69+
70+
- name: Sign the published Docker image
71+
env:
72+
TAGS: ${{ steps.meta.outputs.tags }}
73+
DIGEST: ${{ steps.build-and-push.outputs.digest }}
74+
run: |
75+
images=""
76+
for tag in ${TAGS}; do
77+
images+="${tag}@${DIGEST} "
78+
done
79+
cosign sign --yes ${images}
80+
81+
cleanup:
82+
name: Cleanup Untagged Images
83+
needs: build-and-publish
84+
runs-on: ubuntu-latest
85+
permissions:
86+
packages: write
87+
steps:
88+
- name: Delete untagged images
89+
uses: actions/delete-package-versions@v5
90+
with:
91+
package-name: ${{ github.event.repository.name }}
92+
package-type: "container"
93+
package-origin: "repository"
94+
min-versions-to-keep: 0
95+
delete-only-untagged-versions: "true"

.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# If you prefer the allow list template instead of the deny list, see community template:
2+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
3+
#
4+
# Binaries for programs and plugins
5+
*.exe
6+
*.exe~
7+
*.dll
8+
*.so
9+
*.dylib
10+
11+
# Test binary, built with `go test -c`
12+
*.test
13+
14+
# Code coverage profiles and other test artifacts
15+
*.out
16+
coverage.*
17+
*.coverprofile
18+
profile.cov
19+
20+
# Dependency directories (remove the comment below to include it)
21+
# vendor/
22+
23+
# Go workspace file
24+
go.work
25+
go.work.sum
26+
27+
# env file
28+
.env
29+
30+
# Editor/IDE
31+
# .idea/
32+
# .vscode/

0 commit comments

Comments
 (0)