test pipeline

This commit is contained in:
NCRoxas
2024-09-10 12:20:39 +02:00
parent 281321ad01
commit 87ed27c144
4 changed files with 72 additions and 18 deletions

69
.github/workflows/docker-build.yml vendored Normal file
View File

@@ -0,0 +1,69 @@
name: Docker Build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Install dependencies
run: |
cd web
npm Install
npm run build
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/{{ github.repository }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@@ -25,20 +25,6 @@ builds:
- amd64
- arm64
dockers:
- image_templates:
- ghcr.io/mizuchilabs/mantrae:{{ .Tag }}
- ghcr.io/mizuchilabs/mantrae:latest
use: docker
build_flag_templates:
- --label=org.opencontainers.image.vendor=Mizuchi Labs
- --label=org.opencontainers.image.source=https://github.com/MizuchiLabs/mantrae
- --label=org.opencontainers.image.description=A traefik web UI
- --label=org.opencontainers.image.created={{ .Date }}
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.version={{ .Version }}
upx:
- enabled: true
@@ -46,7 +32,6 @@ release:
draft: true
mode: replace
archives:
- format: binary
name_template: >-
@@ -54,7 +39,7 @@ archives:
{{- if .Arm }}v{{ .Arm }}{{ end }}
snapshot:
name_template: '{{ incpatch .Version }}-next'
version_template: '{{ incpatch .Version }}-next'
report_sizes: true

View File

@@ -50,7 +50,7 @@ docker-push:
.PHONY: release
release:
goreleaser release --clean
goreleaser release --clean --skip=validate
.PHONY: snapshot
snapshot:

2
go.mod
View File

@@ -10,6 +10,7 @@ require (
github.com/joeig/go-powerdns/v3 v3.12.0
github.com/lmittmann/tint v1.0.5
github.com/mattn/go-sqlite3 v1.14.23
github.com/robfig/cron/v3 v3.0.1
golang.org/x/crypto v0.27.0
golang.org/x/net v0.29.0
sigs.k8s.io/yaml v1.4.0
@@ -19,7 +20,6 @@ require (
github.com/goccy/go-json v0.10.3 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
golang.org/x/text v0.18.0 // indirect
golang.org/x/time v0.6.0 // indirect
)