Skip to content

Commit 7bf3131

Browse files
committed
add github actions
1 parent 36a6a9d commit 7bf3131

3 files changed

Lines changed: 46 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: "CI"
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
container:
12+
image: golangci/golangci-lint:v1.20-alpine
13+
options: -w /go/src/github.com/mxssl/wait-for-pg
14+
steps:
15+
- uses: actions/checkout@v1
16+
- name: Install dependencies
17+
run: apk add --no-cache make
18+
- name: Lint
19+
run: make lint
20+
21+
docker-release:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v1
25+
- name: Docker login
26+
run: docker login --username ${{ secrets.DOCKER_LOGIN }} --password ${{ secrets.DOCKER_PASSWORD }}
27+
- name: Docker release
28+
run: make docker-release
29+
30+
github-release:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v1
34+
- name: Set up Go
35+
uses: actions/setup-go@master
36+
with:
37+
go-version: 1.13.4
38+
- name: Run GoReleaser
39+
uses: goreleaser/goreleaser-action@v1
40+
with:
41+
version: v0.123.3
42+
args: release --rm-dist
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ RUN apk add --no-cache \
1515
RUN CGO_ENABLED=0 \
1616
GOOS=`go env GOHOSTOS` \
1717
GOARCH=`go env GOHOSTARCH` \
18-
go build -o wait-for-pg
18+
go build -v -mod=vendor -o wait-for-pg
1919

2020
# Copy compiled binary to clear Alpine Linux image
2121
FROM alpine:3.10.3

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export GO111MODULE=on
99
all: build
1010

1111
build:
12-
go build -o ${BINARY_NAME} -v
12+
go build -v -mod=vendor -o ${BINARY_NAME}
1313

1414
clean:
1515
rm -f ${BINARY_NAME}

0 commit comments

Comments
 (0)