78 lines
3.1 KiB
YAML
78 lines
3.1 KiB
YAML
# Build backend/frontend images, push to Gitea Container Registry, deploy with pull-only compose.
|
|
#
|
|
# Repository Variables (Settings → Actions → Variables) — non-secret:
|
|
# REGISTRY_HOST e.g. 178.131.50.201:3000 (no http/https)
|
|
# REGISTRY_OWNER Gitea user or org that owns the packages (same as image namespace)
|
|
# PUBLIC_BASE_URL URL users open in browser, e.g. http://178.131.50.201:8088 (no trailing slash)
|
|
#
|
|
# Repository Secrets (Settings → Actions → Secrets):
|
|
# REGISTRY_USERNAME Gitea username for docker login
|
|
# REGISTRY_PASSWORD Gitea access token (packages:read/write) or account password
|
|
#
|
|
# HTTP registry (typical self-hosted Gitea): Docker defaults to HTTPS. If login/push fails with
|
|
# "server gave HTTP response to HTTPS client", add REGISTRY_HOST (e.g. 192.168.1.100:3000) to the
|
|
# Docker daemon "insecure-registries" on the RUNNER machine, then restart Docker (Docker Desktop
|
|
# → Settings → Docker Engine → JSON → "insecure-registries": ["host:port"]).
|
|
#
|
|
# Optional:
|
|
# STAGING_HTTP_PORT host port for nginx (default 8088)
|
|
#
|
|
# Required for deploy job (absolute path on the runner host):
|
|
# DEPLOY_SECRETS_DIR folder containing database.staging.env + backend.staging.env
|
|
#
|
|
# Runner: self-hosted with Docker. Default shell is powershell (Windows act_runner often has no WSL bash).
|
|
# For a Linux runner, change defaults.run.shell to bash and restore bash syntax if needed.
|
|
#
|
|
# We do NOT use gitea.com/actions/checkout — many restricted networks cannot reach gitea.com.
|
|
# Checkout is a plain git clone from the same Gitea host.
|
|
|
|
name: Registry — build, push, deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master]
|
|
workflow_dispatch:
|
|
|
|
defaults:
|
|
run:
|
|
shell: powershell
|
|
|
|
jobs:
|
|
temp-success:
|
|
runs-on: self-hosted
|
|
steps:
|
|
- name: Temporary placeholder (always success)
|
|
run: |
|
|
$ErrorActionPreference = 'Stop'
|
|
Write-Host "Temporary workflow is active."
|
|
Write-Host "Trigger: ${{ github.event_name }}"
|
|
Write-Host "Branch: ${{ github.ref_name }}"
|
|
Write-Host "Commit: ${{ github.sha }}"
|
|
Write-Host "Production build/push/deploy steps are intentionally commented."
|
|
exit 0
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Production pipeline is temporarily disabled.
|
|
# Uncomment these jobs after split-DNS / registry reachability is fixed.
|
|
# ---------------------------------------------------------------------------
|
|
#
|
|
# build-and-push:
|
|
# runs-on: self-hosted
|
|
# outputs:
|
|
# image_tag: ${{ steps.meta.outputs.image_tag }}
|
|
# steps:
|
|
# - name: Checkout (clone from this Gitea — no gitea.com)
|
|
# - name: Image tag and registry prefix
|
|
# - name: Log in to container registry
|
|
# - name: Build and push backend
|
|
# - name: Build and push frontend
|
|
#
|
|
# deploy:
|
|
# needs: build-and-push
|
|
# runs-on: self-hosted
|
|
# steps:
|
|
# - name: Checkout (shallow clone from this Gitea — no gitea.com)
|
|
# - name: Write deploy.registry.env and validate secrets path
|
|
# - name: Log in to container registry (for pull)
|
|
# - name: Pull and start stack
|