deployment for docs
All checks were successful
Build and Deploy Antora Docs / build (push) Successful in 30s
Build and Deploy Antora Docs / deploy (push) Successful in 5s

This commit is contained in:
Tobias Brunner 2025-03-10 16:21:06 +01:00
parent 4ee40cdcc1
commit ed5ee7badc
No known key found for this signature in database
5 changed files with 113 additions and 1 deletions

View file

@ -1,4 +1,4 @@
name: Build Antora Docs
name: Build and Deploy Antora Docs
on:
push:
@ -36,3 +36,29 @@ jobs:
tags: ${{ vars.CONTAINER_REGISTRY }}/${{ vars.CONTAINER_IMAGE_NAME_DOCS }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
deploy:
needs: build
runs-on: ubuntu-latest
container: catthehacker/ubuntu:act-latest
environment:
name: prod
url: https://docs.servala.com/
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Deploy to OpenShift
uses: docker://quay.io/appuio/oc:v4.16
with:
entrypoint: /bin/bash
args: |
-c "oc login --token=${OPENSHIFT_TOKEN} --server=${OPENSHIFT_URL} && \
oc -n ${NAMESPACE} apply --overwrite -k docs/deployment/ && \
oc -n ${NAMESPACE} rollout restart deployment/docs"
env:
NAMESPACE: ${{ vars.NAMESPACE_DOCS }}
KUBECONFIG: /tmp/kube_config
OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_TOKEN }}
OPENSHIFT_URL: ${{ secrets.OPENSHIFT_URL }}

View file

@ -0,0 +1,45 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: docs
name: docs
spec:
replicas: 1
revisionHistoryLimit: 2
selector:
matchLabels:
app: docs
strategy:
type: RollingUpdate
template:
metadata:
labels:
app: docs
spec:
containers:
- name: docs
image: servala-2nkgm.app.codey.ch/servala/servala-portal-docs:latest
imagePullPolicy: Always
readinessProbe:
httpGet:
path: /index.html
port: 8080
periodSeconds: 60
livenessProbe:
httpGet:
path: /index.html
port: 8080
periodSeconds: 60
initialDelaySeconds: 5
ports:
- name: http
containerPort: 8080
protocol: TCP
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 10m
memory: 32Mi

View file

@ -0,0 +1,22 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
cert-manager.io/cluster-issuer: letsencrypt-production
name: docs
spec:
rules:
- host: docs.servala.com
http:
paths:
- pathType: Prefix
path: /
backend:
service:
name: docs
port:
number: 8080
tls:
- hosts:
- docs.servala.com
secretName: ingress-cert-docs

View file

@ -0,0 +1,4 @@
resources:
- deployment.yaml
- service.yaml
- ingress.yaml

View file

@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: docs
labels:
app: docs
spec:
ports:
- name: http
port: 8080
protocol: TCP
targetPort: http
selector:
app: docs
type: ClusterIP