Ajouter .forgejo/workflows/deploy.yml
This commit is contained in:
parent
0dce6c1402
commit
5fc1b60890
1 changed files with 29 additions and 0 deletions
29
.forgejo/workflows/deploy.yml
Normal file
29
.forgejo/workflows/deploy.yml
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
name: Deploy to Kubernetes
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy-to-k8s:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout du code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Déployer sur Kubernetes
|
||||||
|
uses: docker://bitnami/kubectl:latest
|
||||||
|
env:
|
||||||
|
KUBECONFIG_DATA: ${{ secrets.KUBECONFIG_DATA }}
|
||||||
|
IMAGE_NAME: registry.example.com/monapp
|
||||||
|
with:
|
||||||
|
entrypoint: /bin/sh
|
||||||
|
args: |
|
||||||
|
-c "
|
||||||
|
echo '$KUBECONFIG_DATA' > kubeconfig.yaml &&
|
||||||
|
export KUBECONFIG=$(pwd)/kubeconfig.yaml &&
|
||||||
|
kubectl set image deployment/mon-deployment mon-container=${IMAGE_NAME}:${GITHUB_REF_NAME} &&
|
||||||
|
kubectl rollout status deployment/mon-deployment
|
||||||
|
"
|
||||||
Loading…
Reference in a new issue