Skip to content

Commit

Permalink
CI: Use goreleaser to deploy to dockerhub
Browse files Browse the repository at this point in the history
  • Loading branch information
MeNsaaH committed Jan 25, 2021
1 parent 779fd67 commit 15dfef6
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: goreleaser
on:
name: deploy
on:
push:
tags:
- '*'
- 'v*'

jobs:
goreleaser:
Expand All @@ -18,6 +18,14 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: 1.15
-
name: Docker Login
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
run: |
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
Expand All @@ -26,3 +34,5 @@ jobs:
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
18 changes: 0 additions & 18 deletions .github/workflows/docker-release.yml

This file was deleted.

11 changes: 10 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ builds:
- goos: darwin
goarch: 386

dockers:
- image_templates:
- mensaah/{{.ProjectName}}
goos: linux
goarch: amd64
goarm: ''
dockerfile: Dockerfile
skip_push: false

archives:
- name_template: "{{.Binary}}_{{.Os}}_{{.Arch}}"
format_overrides:
Expand All @@ -26,4 +35,4 @@ archives:
linux: Linux
windows: Windows
386: i386
amd64: x86_64
amd64: x86_64
14 changes: 6 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
FROM golang:1.15 AS builder
RUN apk update && apk add --no-cache git
WORKDIR $GOPATH/src/github/mensaah/reka/
COPY . .
RUN go get -v
RUN go build -o /go/bin/reka
# Builder image so to add ca-certificates to scratch
FROM golang:alpine as build
RUN apk add -U --no-cache ca-certificates

FROM scratch
COPY --from=builder /go/bin/reka /go/bin/reka
ENTRYPOINT ["/go/bin/reka"]
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY reka /
ENTRYPOINT ["/reka"]
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<br>

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


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)
Expand All @@ -13,7 +14,7 @@ A Cloud Infrastructure Management Tool to stop, resume, clean and destroy resour
- Destroy/Terminate resources
- Clean Up unused resources (such as EBS volumes, Elastic IPs)

### Project Name
#### Project Name
`REKA` is derived from a Native Nigerian Language, Igbo, meaning `Reap`|`Tear Down`.

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

```bash
docker -it -e AWS_ACCESS_KEY -e AWS_SECRET_ACCESS_KEY\
-v `pwd`:/config run mensaah/reka --config /config/config.yaml
docker run -it -e AWS_ACCESS_KEY -e AWS_SECRET_ACCESS_KEY\
-v `pwd`:/config mensaah/reka --config /config/config.yaml
```

#### Go
Expand Down

0 comments on commit 15dfef6

Please sign in to comment.