Skip to content

fix: allow snmp community to come from the request, templating from o… #7

fix: allow snmp community to come from the request, templating from o…

fix: allow snmp community to come from the request, templating from o… #7

name: Build SNMP Exporter
on:
workflow_dispatch:
push:
tags:
- 'v*.*.*'
permissions:
contents: read
packages: write
actions: write
concurrency:
group: snmp_exporter-${{ github.ref }}
cancel-in-progress: true
env:
REGISTRY_IMAGE: ghcr.io/iaa-inc/snmp_exporter
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Generate Token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a
id: generate-token
with:
app_id: ${{ secrets.BOT_APP_ID }}
private_key: ${{ secrets.BOT_APP_PRIVATE_KEY }}
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-go@v5
with:
go-version: 1.22
cache: true
- name: Configure git for private modules
env:
TOKEN: "${{ steps.generate-token.outputs.token }}"
run: git config --global url."https://iaa-inc:${TOKEN}@github.com".insteadOf "https://github.com"
- name: Extract metadata for the Docker image
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
- uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: "${{ steps.generate-token.outputs.token }}"