50 lines
1.4 KiB
YAML
50 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:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
lfs: true
|
|
|
|
- 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=www.siwa-game.fr
|