feat(ci): add Gitea Actions workflow for auto-build on push
Some checks failed
Build smtp-relay / build (push) Failing after 1m36s
Some checks failed
Build smtp-relay / build (push) Failing after 1m36s
- Move build.sh to scripts/build.sh (convention from project-template) - Add .gitea/workflows/build.yml: triggers on push to main when Dockerfile or config files change, builds :dev tag via Kaniko - Every push → CI builds harbor.manabo.org/library/smtp-relay:dev → ArgoCD Image Updater detects new digest → deploys to hermes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9e21e1e669
commit
eb2aec5db5
23
.gitea/workflows/build.yml
Normal file
23
.gitea/workflows/build.yml
Normal file
@ -0,0 +1,23 @@
|
||||
name: Build smtp-relay
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- 'Dockerfile'
|
||||
- 'entrypoint.sh'
|
||||
- 'main.cf'
|
||||
- 'master.cf'
|
||||
- 'smtpd.conf'
|
||||
- 'scripts/build.sh'
|
||||
- '.gitea/workflows/build.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: [self-hosted, valhalla]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Build image (dev)
|
||||
run: bash scripts/build.sh dev
|
||||
@ -1,9 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
# build.sh [tag]
|
||||
# Packages the smtp-relay context, uploads to MinIO, runs Kaniko in-cluster, waits.
|
||||
# scripts/build.sh [tag]
|
||||
# Empaqueta el contexto, sube a MinIO, lanza Kaniko en-cluster, espera.
|
||||
set -euo pipefail
|
||||
|
||||
TAG="${1:-latest}"
|
||||
TAG="${1:-dev}"
|
||||
HARBOR="harbor.manabo.org"
|
||||
IMAGE="${HARBOR}/library/smtp-relay:${TAG}"
|
||||
BUCKET="kaniko-builds"
|
||||
@ -14,10 +14,13 @@ echo "==> Building ${IMAGE}"
|
||||
echo "==> Packaging context ..."
|
||||
tar -czf /tmp/kaniko-context.tar.gz \
|
||||
--exclude='.git' \
|
||||
--exclude='build.sh' \
|
||||
--exclude='k8s' \
|
||||
-C "$(dirname "$0")" .
|
||||
echo "==> Uploading to MinIO (${BUCKET}/${CONTEXT_KEY}) ..."
|
||||
--exclude='scripts' \
|
||||
--exclude='.gitea' \
|
||||
--exclude='README.md' \
|
||||
-C "$(git rev-parse --show-toplevel)" \
|
||||
Dockerfile entrypoint.sh main.cf master.cf smtpd.conf
|
||||
|
||||
echo "==> Uploading to MinIO ..."
|
||||
mc cp /tmp/kaniko-context.tar.gz "minio/${BUCKET}/${CONTEXT_KEY}"
|
||||
rm /tmp/kaniko-context.tar.gz
|
||||
|
||||
Loading…
Reference in New Issue
Block a user