Skip to content

Commit

Permalink
docker and gorelease
Browse files Browse the repository at this point in the history
  • Loading branch information
Navid2zp committed Apr 14, 2021
1 parent 765a484 commit 3e37a01
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Go

on:
pull_request:
branches: [ main ]

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: goreleaser

on:
push:
tags:
- '*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Docker Login
uses: docker/login-action@v1
with:
registry: docker.pkg.github.com
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32 changes: 32 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
builds:
# You can have multiple builds defined as a yaml list
-
# GOOS list to build for.
# For more info refer to: https://golang.org/doc/install/source#environment
# Defaults are darwin and linux.
goos:
- darwin
- linux

# GOARCH to build for.
# For more info refer to: https://golang.org/doc/install/source#environment
# Defaults are 386, amd64 and arm64.
goarch:
- amd64
- arm64
- 386
dockers:
# You can have multiple Docker images.
-
# GOOS of the built binaries/packages that should be used.
goos: linux

# GOARCH of the built binaries/packages that should be used.
goarch: amd64

# Templates of the Docker image names.
image_templates:
- "docker.pkg.github.com/navid2zp/citus-failover/citus-failover:latest"
# Path to the Dockerfile (from the project root).
dockerfile: Dockerfile

9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM ubuntu:latest

WORKDIR ~

COPY citus-failover .

RUN apt-get update && apt-get install -y ca-certificates && apt-get clean

CMD ["./citus-failover", "-f", "config/config.yml"]

0 comments on commit 3e37a01

Please sign in to comment.