chore: add custom metrics to sgController #322
Workflow file for this run
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: Go | |
on: | |
push: | |
branches: [ main ] | |
tags: | |
- '*' | |
pull_request: | |
branches: [ main ] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.21.9 | |
- name: Run lint | |
uses: golangci/golangci-lint-action@v3.1.0 | |
with: | |
version: latest | |
args: --timeout 5m0s | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.21.9 | |
- name: Install dependencies | |
run: sudo apt update && sudo apt install make -y | |
- name: Run tests | |
run: make test-ci | |
docker-image: | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: | |
- tests | |
- lint | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: tfgco/${{ github.event.repository.name }} | |
- name: Build and Push Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: true | |
tags: | | |
${{ steps.meta.outputs.tags }} | |
tfgco/${{ github.event.repository.name }}:latest | |
labels: ${{ steps.meta.outputs.labels }} |