feat(repository): fix linter issues #5
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/CD | |
on: | |
push: | |
branches: [ master ] | |
paths-ignore: | |
- docs/** | |
- configs/** | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22.x' | |
- name: Build | |
run: make build | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22.x' | |
- name: Lint | |
run: make lint | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
needs: [ build, lint ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22.x' | |
- name: Test | |
run: make test | |
- name: Coveralls | |
uses: coverallsapp/github-action@v2 | |
with: | |
file: coverage.out | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
needs: [ test ] | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Extract metadata for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/${{ github.repository }} | |
tags: latest | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
platforms: linux/amd64, linux/arm64, linux/arm64/v8 | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |