@@ -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
|
||||||
Reference in New Issue
Block a user