Files
telegram-shop/.gitea/workflows/release.yaml
NW 5c7bc242c5 ci: registry-based releases — multi-arch images built in CI, servers only pull
- release workflow: buildx multi-arch (amd64+arm64) build+push of bot and admin images to Gitea Container Registry (git.softuniq.eu/telegram-market/telegram-shop[-admin])
- docker-compose: bot/admin use registry images (IMAGE_TAG for pinning); tor-proxy stays local alpine build
- install.sh: pull from registry instead of local docker build (no native compilation on weak hardware); interactive .env setup preserved
- new buildx runner gitea-host-buildx (label buildx) on x86_64 host
- REGISTRY_TOKEN replaced with package-scoped token (write:package)
- README/VERSION/.env.example updated
2026-08-11 10:37:09 +01:00

97 lines
3.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: "Release: multi-arch Docker images"
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
version:
description: "Version tag (without v prefix)"
required: false
default: ""
jobs:
build-push:
# Buildx runner на x86_64 хосте (docker:27.5-cli + host docker.sock).
# Собирает linux/amd64 + linux/arm64 одним buildx build (qemu из коробки)
# и пушит оба образа (бот + Next.js админка) в Gitea Container Registry.
runs-on: buildx
defaults:
run:
shell: sh
env:
REGISTRY: git.softuniq.eu
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
VERSION: ""
steps:
- name: Checkout code
run: |
set -e
apk add --no-cache git curl >/dev/null 2>&1 || true
if [ -n "${GITHUB_REF_NAME}" ] && [ "${GITHUB_REF_NAME}" != "main" ]; then
# Запуск по тегу: clone конкретного тега
REF=${GITHUB_REF_NAME}
elif [ -n "${{ github.event.inputs.version }}" ]; then
REF=v${{ github.event.inputs.version }}
else
REF=${GITHUB_REF_NAME}
fi
echo "REF=${REF}"
cd /tmp
rm -rf release-src
git clone --depth 1 --branch "${REF}" \
"https://oauth2:${REGISTRY_TOKEN}@${REGISTRY}/Telegram-Market/telegram-shop.git" release-src
cd release-src
git rev-parse --short HEAD
- name: Extract version
run: |
if [ -n "${{ github.event.inputs.version }}" ]; then
V=${{ github.event.inputs.version }}
else
V=${GITHUB_REF_NAME#v}
fi
echo "VERSION=${V}" >> "$GITHUB_ENV"
echo "Build version: ${V}"
- name: Login to Gitea Container Registry
run: |
apk add --no-cache docker-cli >/dev/null 2>&1 || true
echo "${REGISTRY_TOKEN}" | docker login ${REGISTRY} -u oauth2 --password-stdin
- name: Build and push bot image (amd64 + arm64)
working-directory: /tmp/release-src
run: |
set -e
docker buildx build \
--platform linux/amd64,linux/arm64 \
--file ./Dockerfile \
--tag ${REGISTRY}/telegram-market/telegram-shop:${VERSION} \
--tag ${REGISTRY}/telegram-market/telegram-shop:latest \
--push \
.
- name: Build and push admin image (amd64 + arm64)
working-directory: /tmp/release-src
run: |
set -e
docker buildx build \
--platform linux/amd64,linux/arm64 \
--file ./admin-next/Dockerfile \
--tag ${REGISTRY}/telegram-market/telegram-shop-admin:${VERSION} \
--tag ${REGISTRY}/telegram-market/telegram-shop-admin:latest \
--push \
./admin-next
- name: Verify pushed manifests
run: |
set -e
apk add --no-cache docker-cli >/dev/null 2>&1 || true
echo "${REGISTRY_TOKEN}" | docker login ${REGISTRY} -u oauth2 --password-stdin >/dev/null 2>&1 || true
docker buildx imagetools inspect ${REGISTRY}/telegram-market/telegram-shop:${VERSION} \
| grep -E "Platform|Digest" | head -4
docker buildx imagetools inspect ${REGISTRY}/telegram-market/telegram-shop-admin:${VERSION} \
| grep -E "Platform|Digest" | head -4
docker logout ${REGISTRY} || true