Skip to content

Commit

Permalink
Add deployment ci config and update goreleaser config to include dock…
Browse files Browse the repository at this point in the history
…er images
  • Loading branch information
arunvelsriram committed Jul 24, 2024
1 parent ff6da8e commit 064c077
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 9 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: goreleaser

on:
push:
tags:
- 'v*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22.5
cache: false

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: '${{ secrets.DOCKERHUB_USERNAME }}'
password: '${{ secrets.DOCKERHUB_PASSWORD }}'

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 14 additions & 9 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
version: 2
before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin
archives:
-
files:
- sftp-exporter.yaml
goarch:
- amd64
- arm
- arm64
dockers:
- image_templates:
- "arunvelsriram/{{ .ProjectName }}:{{ .Tag }}"
- "arunvelsriram/{{ .ProjectName }}:v{{ .Major }}"
- "arunvelsriram/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}"
- "arunvelsriram/{{ .ProjectName }}:latest"
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
name_template: "{{ .ProjectName }}_checksums.txt"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
release:
draft: true

0 comments on commit 064c077

Please sign in to comment.