add: ci integration

This commit is contained in:
Mohamed Sohail 2023-01-06 08:07:19 +00:00
parent df4f188807
commit ed0802d2be
Signed by: kamikazechaser
GPG Key ID: 7DD45520C01CD85D
5 changed files with 98 additions and 0 deletions

9
.deepsource.toml Normal file
View File

@ -0,0 +1,9 @@
version = 1
[[analyzers]]
name = "go"
enabled = true
[analyzers.meta]
import_root = "github.com/grassrootseconomics/cic-custodial"

6
.github/dependabot.yaml vendored Normal file
View File

@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"

35
.github/workflows/release.yaml vendored Normal file
View File

@ -0,0 +1,35 @@
name: goreleaser
on:
push:
tags:
- "v*"
jobs:
goreleaser:
runs-on: ubuntu-latest
environment: build
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19.3
- name: Login to Docker Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: --parallelism 1 --rm-dist --skip-validate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

33
.goreleaser Normal file
View File

@ -0,0 +1,33 @@
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
main: ./cmd
ldflags:
- -s -w
archives:
- format: tar.gz
files:
- LICENSE
- config.toml
- queries.sql
- migrations/*
dockers:
- goos: linux
goarch: amd64
ids:
- cic-chain-events
image_templates:
- "ghcr.io/grassrootseconomics/cic-chain-events/cic-chain-events:latest"
- "ghcr.io/grassrootseconomics/cic-chain-events/cic-chain-events:{{ .Tag }}"
dockerfile: Dockerfile
extra_files:
- LICENSE
- config.toml
- queries.sql
- migrations/*

15
Dockerfile Normal file
View File

@ -0,0 +1,15 @@
FROM debian:11-slim
RUN set -x && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
ca-certificates && \
rm -rf /var/lib/apt/lists/*
WORKDIR /cic-chain-events
COPY cic-chain-events .
COPY config.toml .
COPY queries.sql .
COPY LICENSE .
COPY migrations migrations/
CMD ["./cic-chain-events"]