This commit is contained in:
Marcus 2026-01-31 11:12:41 -03:00
parent 7eaacae61e
commit d87f6e5604
2 changed files with 51 additions and 54 deletions

View file

@ -15,7 +15,7 @@ spec:
env: development env: development
spec: spec:
imagePullSecrets: imagePullSecrets:
- name: registry-auth - name: forgejo-registry
initContainers: initContainers:
- name: set-mtu - name: set-mtu
image: busybox image: busybox

View file

@ -1,53 +1,50 @@
build-and-push: apiVersion: apps/v1
runs-on: docker-ready kind: Deployment
env: metadata:
DOCKER_API_VERSION: "1.43" name: gohorse-backoffice-dev
REGISTRY: pipe.gohorsejobs.com namespace: gohorsejobsdev
defaults: spec:
run: replicas: 1
shell: sh selector:
steps: matchLabels:
- name: Install Dependencies app: gohorse-backoffice-dev
run: | template:
sed -i 's/dl-cdn.alpinelinux.org/mirror.leaseweb.com/g' /etc/apk/repositories metadata:
apk add --no-cache git docker-cli docker-cli-buildx nodejs labels:
app: gohorse-backoffice-dev
- name: Checkout code env: development
uses: actions/checkout@v4 spec:
with: imagePullSecrets:
fetch-depth: 1 - name: forgejo-registry
initContainers:
# REMOVIDO: docker buildx create (Isso estava isolando o login e causando o 401) - name: set-mtu
image: busybox
- name: Login to Forgejo Registry # CORREÇÃO: Usando $(VAR) para o Kubernetes injetar o valor corretamente
uses: docker/login-action@v3 command: ['sh', '-c', 'ifconfig eth0 mtu $(MTU_VALUE) || true']
with: env:
registry: ${{ env.REGISTRY }} - name: MTU_VALUE
username: bohessefm valueFrom:
password: ${{ secrets.FORGEJO_TOKEN }} secretKeyRef:
name: backend-secrets
- name: Build and Push Backend key: MTU
uses: docker/build-push-action@v5 securityContext:
with: privileged: true
context: ./backend containers:
file: ./backend/Dockerfile - name: backoffice
push: true image: pipe.gohorsejobs.com/bohessefm/backoffice:latest
# Força o uso do builder padrão do host que JÁ ESTÁ LOGADO imagePullPolicy: Always
builder: default ports:
provenance: false - containerPort: 3001
tags: | envFrom:
${{ env.REGISTRY }}/bohessefm/gohorsejobs:latest - secretRef:
${{ env.REGISTRY }}/bohessefm/gohorsejobs:${{ github.sha }} name: backend-secrets
env:
- name: Build and Push Backoffice - name: NODE_TLS_REJECT_UNAUTHORIZED
uses: docker/build-push-action@v5 value: "0"
with: resources:
context: ./backoffice requests:
file: ./backoffice/Dockerfile memory: "512Mi" # Reduzi um pouco o request para facilitar o agendamento no nó
push: true cpu: "300m"
# Força o uso do builder padrão do host que JÁ ESTÁ LOGADO limits:
builder: default memory: "2Gi"
provenance: false cpu: "800m"
tags: |
${{ env.REGISTRY }}/bohessefm/backoffice:latest
${{ env.REGISTRY }}/bohessefm/backoffice:${{ github.sha }}