Files
CoqBlog/.gitea/workflows/deploy.yml
T
alois 9cd0692808
Build and Deploy Hugo / build (push) Failing after 4s
fix: deploy
2026-05-21 11:46:35 +00:00

51 lines
1.4 KiB
YAML

name: Build and Deploy Hugo
on:
push:
branches:
- main
jobs:
build:
runs-on: native
steps:
- name: Checkout
run: |
git clone --recurse-submodules https://git.alocoq.fr/alois/CoqBlog.git .
ls -la themes/
ls -la themes/PaperMod/
- name: Install Hugo
run: |
apk add --no-cache hugo git
hugo version
- name: Build
run: hugo --minify
- name: Install kubectl
run: |
wget -q https://dl.k8s.io/release/v1.31.0/bin/linux/amd64/kubectl
chmod +x kubectl
mv kubectl /usr/local/bin/kubectl
- name: Deploy
env:
KUBE_TOKEN: ${{ secrets.KUBE_TOKEN }}
KUBE_SERVER: ${{ secrets.KUBE_SERVER }}
run: |
kubectl config set-cluster homelab \
--server=${KUBE_SERVER} \
--insecure-skip-tls-verify=true
kubectl config set-credentials deployer \
--token=${KUBE_TOKEN}
kubectl config set-context homelab \
--cluster=homelab \
--user=deployer
kubectl config use-context homelab
# Désactive l'auto-detection du ServiceAccount K8s
unset KUBERNETES_SERVICE_HOST
unset KUBERNETES_SERVICE_PORT
POD=$(kubectl get pods -n blog -l app=hugo-nginx -o jsonpath='{.items[0].metadata.name}')
kubectl cp public/. blog/${POD}:/usr/share/nginx/html/