Skip to content

Commit

Permalink
ci: use KO for publishing docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
dundee committed Feb 28, 2024
1 parent 49e670b commit fb7294c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 29 deletions.
37 changes: 9 additions & 28 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,19 @@ on:
push:
branches:
- 'master'
- 'ko'
tags:
- 'v*'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
docker:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Login to registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Docker meta
id: meta
uses: docker/metadata-action@v5
- uses: actions/setup-go@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
go-version: '1.22.x'
- uses: actions/checkout@v3

- uses: ko-build/[email protected]
- run: ko build ./cmd/gdu
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/library/golang:1.20 as builder
FROM docker.io/library/golang:1.22 as builder

WORKDIR /app

Expand Down

0 comments on commit fb7294c

Please sign in to comment.