From 2280c0f4830ece4409cf1a964bd2f40bb496d074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alo=C3=AFs=20Coquillard?= Date: Thu, 21 May 2026 15:47:01 +0000 Subject: [PATCH] =?UTF-8?q?ajouter=20le=20d=C3=A9ploiement=20php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy.yml | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..d9059a3 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,39 @@ +name: Deploy PHP + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Checkout + run: | + git clone --depth 1 https://git.alocoq.fr/sushi/Camilou.fr.git . + + - name: Install kubectl + run: | + apk add --no-cache curl + curl -LO 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 + POD=$(kubectl get pods -n sushi -l app=sushi -o jsonpath='{.items[0].metadata.name}') + kubectl cp . sushi/${POD}:/var/www/html/ -c nginx \ No newline at end of file