Skip to content

Commit

Permalink
build: ko, gha
Browse files Browse the repository at this point in the history
  • Loading branch information
calmh committed Dec 17, 2024
1 parent 946489d commit a290492
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 20 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and Publish

on:
push:

permissions:
packages: write
contents: write

jobs:
build-and-push-docker-image:
name: Build Docker image and push
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 'stable'

- name: Setup ko
uses: ko-build/[email protected]

- name: Login to Github Packages
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build containers
run: |
descr=$(git describe)
export version="${descr#v}"
ko build --bare --sbom=none -t latest -t "$version" .
env:
KO_DOCKER_REPO: ghcr.io/syncthing/infra/roadmap-votes
3 changes: 3 additions & 0 deletions .ko.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
defaultPlatforms:
- linux/arm64
- linux/amd64
20 changes: 0 additions & 20 deletions Dockerfile

This file was deleted.

0 comments on commit a290492

Please sign in to comment.