Skip to content

refactor: Using LogAttrs #1006

refactor: Using LogAttrs

refactor: Using LogAttrs #1006

Workflow file for this run

---
name: Build
permissions:
actions: none
checks: none
contents: read
deployments: none
issues: none
packages: none
pages: none
pull-requests: none
repository-projects: none
security-events: none
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
SCRIPTS_NO_INTERACTIVE: "true"
defaults:
run:
shell: bash
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version: "^1.21"
cache: true
- name: Build
run: |
make
git --no-pager diff -- ':(exclude)go.sum' && git diff --quiet -- ':(exclude)go.sum'
- name: Codecov
uses: codecov/codecov-action@v3
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: SonarCloud
if: env.SONAR_TOKEN
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
package:
name: Docker
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version: "^1.21"
cache: true
- name: Build
env:
GO_ARCHS: linux/amd64 linux/arm linux/arm64 darwin/amd64 darwin/arm64
run: |
curl --disable --silent --show-error --location --max-time 30 "https://raw.githubusercontent.com/ViBiOh/scripts/main/bootstrap" | bash -s -- "-c" "release"
./scripts/release build
- name: Setup Docker
uses: docker/setup-buildx-action@v3
- name: Setup DockerHub
if: env.DOCKER_USER && env.DOCKER_PASS
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Docker
if: env.DOCKER_USER && env.DOCKER_PASS
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
run: |
DOCKER_IMAGE="${{ secrets.DOCKER_USER }}/$(make name)" IMAGE_VERSION="$(make version)" GIT_SHA="$(make version-full)" ./scripts/release docker
publish:
name: Publish
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: package
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Publish
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
run: |
curl --disable --silent --show-error --location --max-time 30 "https://raw.githubusercontent.com/ViBiOh/scripts/main/bootstrap" | bash -s -- "-c" "docker_promote"
scripts/docker_promote -d "$(make version-date)" "${{ secrets.DOCKER_USER }}/$(make name)" "$(make version)"
- name: Flux
env:
FLUX_TOKEN: ${{ secrets.FLUX_TOKEN }}
FLUX_WEBHOOK_URL: ${{ secrets.FLUX_WEBHOOK_URL }}
run: |
curl --disable --silent --show-error --location --max-time 30 --header "X-Signature: sha256=$(printf "{}" | openssl dgst -sha256 -r -hmac "${FLUX_TOKEN}"| awk '{print $1}')" --data "{}" "${FLUX_WEBHOOK_URL}"