deployment for docs
This commit is contained in:
parent
4ee40cdcc1
commit
ed5ee7badc
5 changed files with 113 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
||||||
name: Build Antora Docs
|
name: Build and Deploy Antora Docs
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
@ -36,3 +36,29 @@ jobs:
|
||||||
tags: ${{ vars.CONTAINER_REGISTRY }}/${{ vars.CONTAINER_IMAGE_NAME_DOCS }}:latest
|
tags: ${{ vars.CONTAINER_REGISTRY }}/${{ vars.CONTAINER_IMAGE_NAME_DOCS }}:latest
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
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 }}
|
||||||
|
|
45
docs/deployment/deployment.yaml
Normal file
45
docs/deployment/deployment.yaml
Normal 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
|
22
docs/deployment/ingress.yaml
Normal file
22
docs/deployment/ingress.yaml
Normal 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
|
4
docs/deployment/kustomization.yaml
Normal file
4
docs/deployment/kustomization.yaml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
resources:
|
||||||
|
- deployment.yaml
|
||||||
|
- service.yaml
|
||||||
|
- ingress.yaml
|
15
docs/deployment/service.yaml
Normal file
15
docs/deployment/service.yaml
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue