Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

Commit

Permalink
Move to ko for builds (#553)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsouza authored Nov 28, 2023
1 parent 8fb3422 commit 168d9df
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 58 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/docker-tests.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: docker-push
name: ko-build
on:
push:
branches:
Expand All @@ -17,33 +17,31 @@ jobs:
uses: docker/[email protected]
with:
images: fsouza/s3-upload-proxy
sep-tags: ","
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: setup qemu
uses: docker/[email protected]

- name: setup buildx
id: buildx
uses: docker/[email protected]

- name: login to docker hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: build and push
uses: docker/[email protected]
- uses: actions/[email protected]
id: setup-go
with:
cache-from: fsouzaci/gha-cache:s3-upload-proxy
cache-to: fsouzaci/gha-cache:s3-upload-proxy
context: .
push: ${{ github.ref_type == 'tag' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
go-version: "1.21"

- uses: ko-build/[email protected]

- name: ko build
run: |
ko build --platform=all --bare --tags="$(echo "${RAW_TAGS}" | sed -e 's;fsouza/s3-upload-proxy:;;g')"
env:
KO_DEFAULTBASEIMAGE: fsouza/alpine-base
KO_DOCKER_REPO: fsouza/s3-upload-proxy
RAW_TAGS: ${{ steps.meta.outputs.tags }}
39 changes: 39 additions & 0 deletions .github/workflows/ko-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: ko-test
on:
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]

- name: docker meta
id: meta
uses: docker/[email protected]
with:
images: fsouza/s3-upload-proxy
sep-tags: ","
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- uses: actions/[email protected]
id: setup-go
with:
go-version: "1.21"

- uses: ko-build/[email protected]

- name: ko build
run: |
ko build --platform=all --bare --tags="$(echo "${RAW_TAGS}" | sed -e 's;fsouza/s3-upload-proxy:;;g')"
env:
KO_DEFAULTBASEIMAGE: fsouza/alpine-base
KO_DOCKER_REPO: ko.local/fsouza/s3-upload-proxy
RAW_TAGS: ${{ steps.meta.outputs.tags }}
14 changes: 0 additions & 14 deletions Dockerfile

This file was deleted.

0 comments on commit 168d9df

Please sign in to comment.