backupy-agent/.github/workflows/release.yml
TronoSfera 8b0c978337 feat(initial): Backupy agent + backupy-decrypt CLI
Source ports from the TronoSfera/backupy-cloud monorepo:
- apps/agent/        — Go agent (WSS client, persistent queue, Docker
                       discovery, 5 DB drivers: PG/MySQL/Mongo/Redis/SQLite,
                       pre/post hooks, Prometheus metrics)
- apps/backupy-decrypt/ — standalone CLI for client-side decryption
- packages/proto/    — protobuf wire format (generated .pb.go committed
                       so the repo builds without protoc)
- docs/              — agent spec + wire-protocol contract

Apache-2.0 license. Image published to ghcr.io/tronosfera/backupy-agent
on every v* tag via .github/workflows/release.yml (multi-arch amd64+arm64).
2026-05-17 20:22:35 +03:00

78 lines
2.4 KiB
YAML

# Builds the agent as a multi-arch image and publishes to GHCR on every
# tag matching `v*`. The image gets three tags:
# ghcr.io/tronosfera/backupy-agent:vX.Y.Z (always)
# ghcr.io/tronosfera/backupy-agent:vX.Y (always)
# ghcr.io/tronosfera/backupy-agent:latest (only on non-prerelease tags)
#
# Uses the workflow's GITHUB_TOKEN — no extra secrets needed.
name: release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag:
description: "Tag to (re-)build (e.g. v0.1.0)"
required: true
permissions:
contents: read
packages: write
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64,linux/arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Derive metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/backupy-agent
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable=${{ !contains(github.ref_name, '-') }}
labels: |
org.opencontainers.image.title=backupy-agent
org.opencontainers.image.description=Open-source backup agent for backupy.tronosfera.ru
org.opencontainers.image.licenses=Apache-2.0
org.opencontainers.image.source=https://github.com/${{ github.repository }}
- name: Build & push
uses: docker/build-push-action@v6
with:
context: .
file: apps/agent/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION=${{ github.ref_name }}
COMMIT=${{ github.sha }}
BUILD_DATE=${{ github.event.repository.updated_at }}
cache-from: type=gha
cache-to: type=gha,mode=max