Files
Verso/.gitea/workflows/deploy-verso.yml
T
alois 3fe806fc0e
Build and Deploy Verso / deploy (push) Has been cancelled
Actualiser .gitea/workflows/deploy-verso.yml
2026-05-29 17:46:19 +00:00

86 lines
2.4 KiB
YAML

name: Build and Deploy Verso
on:
push:
branches:
- main
workflow_dispatch:
env:
IMAGE: registry.alocoq.fr/verso:latest
REPO_URL: https://git.alocoq.fr/alois/verso.git
jobs:
deploy:
runs-on: native
timeout-minutes: 60
steps:
- name: Build and push image with Kaniko
run: |
kubectl -n ci delete job verso-kaniko --ignore-not-found=true
cat <<'EOF' | kubectl apply -f -
apiVersion: batch/v1
kind: Job
metadata:
name: verso-kaniko
namespace: ci
spec:
backoffLimit: 0
template:
spec:
restartPolicy: Never
initContainers:
- name: prepare
image: alpine/git:latest
command:
- sh
- -c
- |
set -eux
git clone --depth 1 https://git.alocoq.fr/alois/verso.git /workspace/repo
volumeMounts:
- name: workspace
mountPath: /workspace
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:debug
args:
- --context=dir:///workspace/repo/server-ce
- --dockerfile=/workspace/repo/server-ce/Dockerfile
- --destination=registry.alocoq.fr/verso:latest
volumeMounts:
- name: workspace
mountPath: /workspace
volumes:
- name: workspace
emptyDir: {}
EOF
- name: Wait for build
run: |
kubectl -n ci wait --for=condition=complete job/verso-kaniko --timeout=3600s
- name: Show logs
if: always()
run: |
kubectl -n ci logs job/verso-kaniko -c prepare || true
kubectl -n ci logs job/verso-kaniko -c kaniko || true
- name: Deploy
run: |
kubectl -n verso-dev set image deployment/verso \
verso=registry.alocoq.fr/verso:latest
kubectl -n verso-dev rollout restart deployment/verso
kubectl -n verso-dev rollout status deployment/verso
- name: Cleanup
if: always()
run: |
kubectl -n ci delete job verso-kaniko --ignore-not-found=true