siwa-game.fr/.forgejo/workflows/deploy.yaml
Sébastien Faguet 3df04a4095
Some checks failed
/ build-and-deploy (push) Failing after 17s
feat: valid CICD
2026-05-07 17:08:55 +02:00

49 lines
1.4 KiB
YAML

on:
push:
branches: [main]
pull_request:
jobs:
build-and-deploy:
runs-on: koda
env:
NAMESPACE: clem-siwa-game-prd
REGISTRY: clem-siwa-game
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Helm lint charts
run: |
helm lint charts
- name: Docker login
run: |
docker login $REGISTRY_URL -u $REGISTRY_USER --password "$REGISTRY_PASS"
- name: Build and push hugo
run: |
docker build --progress=plain -t $REGISTRY_URL/$REGISTRY/clem-hugo:${{ github.sha }} .
docker push $REGISTRY_URL/$REGISTRY/clem-hugo:${{ github.sha }}
- name: Ensure namespace exists
run: |
kubectl get ns $NAMESPACE || kubectl create namespace $NAMESPACE
- name: Delete existing imagePullSecret (if exists)
run: |
kubectl delete secret registry-creds -n $NAMESPACE --ignore-not-found
- name: Copy imagePullSecret to namespace
run: |
kubectl get secret registry-creds -n servadmin -o yaml \
| sed "s/namespace: servadmin/namespace: $NAMESPACE/" \
| kubectl apply -f -
- name: Deploy with Helm
run: |
helm upgrade --install hugo charts \
--namespace $NAMESPACE \
--set hugo.repository=$REGISTRY_URL/$REGISTRY/clem-hugo \
--set hugo.tag=${{ github.sha }} \
--set hugo.domain=preprod.siwa-game.fr