ci: gitea actions build/push + argocd registry repoint

This commit is contained in:
ahp
2026-10-18 16:27:58 +03:30
parent 3bf6dae724
commit 6dc04de222
3 changed files with 73 additions and 9 deletions
+62
View File
@@ -0,0 +1,62 @@
name: build-and-push
# On a version tag push (v*), build both images and publish them to the
# Gitea container registry. Argo CD then rolls them out via
# deploy/helm/pargar (values-apollo.yaml pins the matching image tags).
#
# Requires a registered Gitea Actions runner and `permissions.packages: write`
# so the built-in job token (secrets.GITEA_TOKEN) can push to the registry.
on:
push:
tags:
- "v*"
permissions:
contents: read
packages: write
env:
REGISTRY: src.panahifar.ir
BACKEND_IMAGE: ahp/pargar-backend
FRONTEND_IMAGE: ahp/pargar-frontend
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Image tag (strip leading v)
id: meta
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Login to Gitea container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITEA_TOKEN }}
- name: Build and push backend
uses: docker/build-push-action@v6
with:
context: ./backend
push: true
tags: |
${{ env.REGISTRY }}/${{ env.BACKEND_IMAGE }}:${{ steps.meta.outputs.version }}
${{ env.REGISTRY }}/${{ env.BACKEND_IMAGE }}:latest
- name: Build and push frontend
uses: docker/build-push-action@v6
with:
context: ./frontend
push: true
# Empty = same-origin API/WS through the Traefik reverse proxy
# (the production topology). Override via repo variables if needed.
build-args: |
NEXT_PUBLIC_API_URL=${{ vars.NEXT_PUBLIC_API_URL }}
NEXT_PUBLIC_WS_URL=${{ vars.NEXT_PUBLIC_WS_URL }}
tags: |
${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE }}:${{ steps.meta.outputs.version }}
${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE }}:latest
+4 -3
View File
@@ -11,7 +11,7 @@ backend:
image: image:
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
repository: pargar-backend repository: pargar-backend
tag: 0.2.1 tag: 0.3.5
metrics: metrics:
serviceMonitor: serviceMonitor:
enabled: true enabled: true
@@ -41,7 +41,7 @@ frontend:
image: image:
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
repository: pargar-frontend repository: pargar-frontend
tag: 0.2.1 tag: 0.3.5
podDisruptionBudget: podDisruptionBudget:
enabled: false enabled: false
replicaCount: 2 replicaCount: 2
@@ -55,7 +55,8 @@ frontend:
global: global:
domain: pargar.panahifar.ir domain: pargar.panahifar.ir
frontendOrigins: https://pargar.panahifar.ir frontendOrigins: https://pargar.panahifar.ir
imageRegistry: "" # Images published by .gitea/workflows/build-and-push.yaml on tag push.
imageRegistry: src.panahifar.ir/ahp
publicUrl: https://pargar.panahifar.ir publicUrl: https://pargar.panahifar.ir
imagePullSecrets: [] imagePullSecrets: []
ingress: ingress:
+7 -6
View File
@@ -3,25 +3,26 @@
# -f deploy/helm/pargar/values-prod.yaml # -f deploy/helm/pargar/values-prod.yaml
# #
# Prerequisites: # Prerequisites:
# - images pushed to ghcr.io/pargar/{backend,frontend}:<tag> # - images pushed to src.panahifar.ir/ahp/{pargar-backend,pargar-frontend}:<tag>
# (by .gitea/workflows/build-and-push.yaml on a v* tag push)
# - Secret pargar-app (jwt-secret, admin-password, metrics-token, database-url, redis-url, # - Secret pargar-app (jwt-secret, admin-password, metrics-token, database-url, redis-url,
# storage-access-key, storage-secret-key) # storage-access-key, storage-secret-key)
# - cert-manager ClusterIssuer letsencrypt-prod # - cert-manager ClusterIssuer letsencrypt-prod
# - imagePullSecrets if the registry is private # - imagePullSecrets if the Gitea package registry visibility is private
global: global:
domain: app.example.com domain: app.example.com
publicUrl: https://app.example.com publicUrl: https://app.example.com
frontendOrigins: "https://app.example.com" frontendOrigins: "https://app.example.com"
imageRegistry: ghcr.io/pargar imageRegistry: src.panahifar.ir/ahp
imagePullSecrets: imagePullSecrets:
- name: ghcr-pull - name: gitea-pull
backend: backend:
replicaCount: 2 replicaCount: 2
image: image:
repository: backend repository: pargar-backend
tag: "0.2.1" tag: "0.2.1"
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
existingSecret: pargar-app existingSecret: pargar-app
@@ -48,7 +49,7 @@ backend:
frontend: frontend:
replicaCount: 2 replicaCount: 2
image: image:
repository: frontend repository: pargar-frontend
tag: "0.2.1" tag: "0.2.1"
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
resources: resources: