Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI

on:
push:
branches: [master]
pull_request:
types: [opened, synchronize]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
# - run: go mod tidy && git diff -s --exit-code go.sum
- run: make test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: make build-image
20 changes: 20 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Release

on:
push:
tags: ["v*"]

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: make push-image
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN apk update && apk add git && apk add curl
WORKDIR /go/src/github.com/planetlabs/draino
COPY . .

RUN go build -o /draino ./cmd/draino
RUN CGO_ENABLED=0 go build -o /draino ./cmd/draino

FROM alpine:3.11

Expand Down
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
IMG_REG ?= ghcr.io/pfnet/draino
IMG_TAG ?= $(shell git describe --always --tags --dirty)

.PHONY: build
build:
go build -o draino ./cmd/draino

.PHONY: test
test:
go vet ./...
go test -v ./...

.PHONY: build-image
build-image:
docker build --progress plain -t $(IMG_REG):$(IMG_TAG) .

.PHONY: push-image
push-image: build-image
docker tag $(IMG_REG):$(IMG_TAG) $(IMG_REG):latest
docker push $(IMG_REG):$(IMG_TAG)
docker push $(IMG_REG):latest