Skip to content

Commit e13b331

Browse files
committed
build: ko, gha
1 parent 8fb6c28 commit e13b331

File tree

3 files changed

+45
-20
lines changed

3 files changed

+45
-20
lines changed

.github/workflows/build-publish.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build and Publish
2+
3+
on:
4+
push:
5+
6+
permissions:
7+
packages: write
8+
contents: write
9+
10+
jobs:
11+
build-and-push-docker-image:
12+
name: Build Docker image and push
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Setup Go
22+
uses: actions/setup-go@v4
23+
with:
24+
go-version: 'stable'
25+
26+
- name: Setup ko
27+
uses: ko-build/[email protected]
28+
29+
- name: Login to Github Packages
30+
uses: docker/login-action@v3
31+
with:
32+
registry: ghcr.io
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Build containers
37+
run: |
38+
descr=$(git describe)
39+
export version="${descr#v}"
40+
ko build --bare --sbom=none -t latest -t "$version" .
41+
env:
42+
KO_DOCKER_REPO: ghcr.io/syncthing/roadmap-votes

.ko.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
defaultPlatforms:
2+
- linux/arm64
3+
- linux/amd64

Dockerfile

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)