chore: add CI, dependabot, and release workflow

This commit is contained in:
Arkadiy Kukarkin
2026-05-26 21:55:09 +02:00
parent df0b4b4a76
commit 5261ee927e
3 changed files with 83 additions and 0 deletions

22
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,22 @@
version: 2
updates:
# go modules -- one grouped PR for everything
- package-ecosystem: gomod
directory: /
schedule:
interval: weekly
groups:
go-deps:
patterns: ["*"]
# dockerfile base images (golang, alpine)
- package-ecosystem: docker
directory: /
schedule:
interval: weekly
# the workflow actions themselves
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly

36
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,36 @@
name: ci
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
services:
redis:
image: redis:alpine
ports:
- 6379:6379
env:
TEST_REDIS_ADDR: localhost:6379
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- run: go build ./...
- run: go vet ./...
- run: go test ./...
vuln:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: golang/govulncheck-action@v1
with:
go-version-file: go.mod

25
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,25 @@
# rolling :latest image, published manually from the Actions tab (Run workflow)
name: release
on:
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
ghcr.io/parkan/go-hauk:latest
ghcr.io/parkan/go-hauk:${{ github.sha }}