[DEPS]: Upgrade deps and migrate to slog / promslog #78
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
branches: | |
- "main" | |
pull_request: | |
branches: | |
- "main" | |
jobs: | |
tests: | |
name: Tests & Linters | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22' | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: "Run Linters" | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: latest | |
args: --verbose | |
- name: Run tests | |
run: go test -v ./... | |
build: | |
name: Build & Publish on Tag | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
with: | |
fetch-depth: 1 | |
- name: Get TAG | |
id: get_tag | |
run: echo TAG=${GITHUB_REF#refs/tags/} >> $GITHUB_ENV | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
ghcr.io/AthennaMind/opnsense-exporter | |
tags: | | |
type=semver,pattern={{version}} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GHCR | |
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Release build | |
id: release_build | |
uses: docker/build-push-action@v3 | |
with: | |
platforms: linux/amd64,linux/arm/v6,linux/arm64 | |
build-args: | | |
Version=${{ env.TAG }} | |
context: . | |
push: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |