Skip to content

Commit 15dfef6

Browse files
committed
CI: Use goreleaser to deploy to dockerhub
1 parent 779fd67 commit 15dfef6

File tree

5 files changed

+33
-33
lines changed

5 files changed

+33
-33
lines changed
Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: goreleaser
2-
on:
1+
name: deploy
2+
on:
33
push:
44
tags:
5-
- '*'
5+
- 'v*'
66

77
jobs:
88
goreleaser:
@@ -18,6 +18,14 @@ jobs:
1818
uses: actions/setup-go@v2
1919
with:
2020
go-version: 1.15
21+
-
22+
name: Docker Login
23+
env:
24+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
25+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
26+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
27+
run: |
28+
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin
2129
-
2230
name: Run GoReleaser
2331
uses: goreleaser/goreleaser-action@v2
@@ -26,3 +34,5 @@ jobs:
2634
args: release --rm-dist
2735
env:
2836
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
37+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
38+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

.github/workflows/docker-release.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.goreleaser.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ builds:
1616
- goos: darwin
1717
goarch: 386
1818

19+
dockers:
20+
- image_templates:
21+
- mensaah/{{.ProjectName}}
22+
goos: linux
23+
goarch: amd64
24+
goarm: ''
25+
dockerfile: Dockerfile
26+
skip_push: false
27+
1928
archives:
2029
- name_template: "{{.Binary}}_{{.Os}}_{{.Arch}}"
2130
format_overrides:
@@ -26,4 +35,4 @@ archives:
2635
linux: Linux
2736
windows: Windows
2837
386: i386
29-
amd64: x86_64
38+
amd64: x86_64

Dockerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
FROM golang:1.15 AS builder
2-
RUN apk update && apk add --no-cache git
3-
WORKDIR $GOPATH/src/github/mensaah/reka/
4-
COPY . .
5-
RUN go get -v
6-
RUN go build -o /go/bin/reka
1+
# Builder image so to add ca-certificates to scratch
2+
FROM golang:alpine as build
3+
RUN apk add -U --no-cache ca-certificates
74

85
FROM scratch
9-
COPY --from=builder /go/bin/reka /go/bin/reka
10-
ENTRYPOINT ["/go/bin/reka"]
6+
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
7+
COPY reka /
8+
ENTRYPOINT ["/reka"]

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<br>
55

66
[![Build Status](https://github.com/mensaah/reka/workflows/Test/badge.svg)](https://github.com/mensaah/reka/actions)
7+
[![deploy](https://github.com/MeNsaaH/reka/workflows/deploy/badge.svg)](https://github.com/mensaah/reka/actions)
78

89

910
A Cloud Infrastructure Management Tool to stop, resume, clean and destroy resources based on tags. Reka uses a config to determine what actions should be taken on resources. It can prove to be a cost management tool where you can stop your tests environments during breaks, holidays and non-working hours. It can also be a nuke tool to nuke an account. It currently supports both AWS and GCP. A full list of supported resources can be found [here](./docs/supported-resources.md)
@@ -13,7 +14,7 @@ A Cloud Infrastructure Management Tool to stop, resume, clean and destroy resour
1314
- Destroy/Terminate resources
1415
- Clean Up unused resources (such as EBS volumes, Elastic IPs)
1516

16-
### Project Name
17+
#### Project Name
1718
`REKA` is derived from a Native Nigerian Language, Igbo, meaning `Reap`|`Tear Down`.
1819

1920
### BEWARE!
@@ -48,8 +49,8 @@ The reka image is also available on DockerHub.
4849
If `config.yaml` is in the current directory, reka can be executed as:
4950

5051
```bash
51-
docker -it -e AWS_ACCESS_KEY -e AWS_SECRET_ACCESS_KEY\
52-
-v `pwd`:/config run mensaah/reka --config /config/config.yaml
52+
docker run -it -e AWS_ACCESS_KEY -e AWS_SECRET_ACCESS_KEY\
53+
-v `pwd`:/config mensaah/reka --config /config/config.yaml
5354
```
5455

5556
#### Go

0 commit comments

Comments
 (0)