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