Quick Start
Prerequis
Section intitulée « Prerequis »- Un repo GitHub dans l’organisation HomeserveFR
- Un workflow GitHub Actions avec le deployer reusable
- Un fichier
deployer.yamla la racine du projet
1. Creer le deployer.yaml
Section intitulée « 1. Creer le deployer.yaml »name: mon-apinamespace: mon-apivaultSecretsPath: secret/platform/apps/mon-namespace/mon-api
databases: pgs: - name: mon_api
features: - redis
migration: enable: true useAppImg: true command: ["npm", "run", "migrate"]
livenessProbe: httpGet: path: /health port: 3000 initialDelaySeconds: 10 timeoutSeconds: 5
readinessProbe: httpGet: path: /health port: 3000 initialDelaySeconds: 5 timeoutSeconds: 5
environmentVariables: - name: DATABASE_URL value: "postgresql://$(PG_USER_MON_API):$(PG_PASS_MON_API)@$(PG_HOST_MON_API)/$(PG_DBNAME_MON_API)" - name: REDIS_URL value: "vault:secret/platform/redis#redis1_url"name: mon-appnamespace: mon-appvaultSecretsPath: secret/platform/apps/mon-namespace/mon-app
databases: pgs: - name: mon_app
features: - nginx-php - redis
migration: enable: true useAppImg: true command: ["/bin/sh", "-c", "php bin/console doctrine:migrations:migrate --no-interaction"]
livenessProbe: httpGet: path: /health port: 80 timeoutSeconds: 20 periodSeconds: 5
readinessProbe: httpGet: path: /health port: 80 timeoutSeconds: 20 periodSeconds: 5
environmentVariables: - name: DATABASE_URL value: "postgresql://$(PG_USER_MON_APP):$(PG_PASS_MON_APP)@$(PG_HOST_MON_APP)/$(PG_DBNAME_MON_APP)" - name: REDIS_URL value: "vault:secret/platform/redis#redis1_url"name: mon-apinamespace: mon-apivaultSecretsPath: secret/platform/apps/mon-namespace/mon-api
databases: pgs: - name: mon_api
migration: enable: true useAppImg: true command: ["python", "manage.py", "migrate", "--noinput"]
livenessProbe: httpGet: path: /health port: 8000 initialDelaySeconds: 15 timeoutSeconds: 5
readinessProbe: httpGet: path: /health port: 8000 initialDelaySeconds: 10 timeoutSeconds: 5
environmentVariables: - name: DATABASE_URL value: "postgresql://$(PG_USER_MON_API):$(PG_PASS_MON_API)@$(PG_HOST_MON_API)/$(PG_DBNAME_MON_API)"# Site statique (HTML, Hugo, Jekyll...)name: mon-sitecodeType: Static# SPA (Vue, React, Angular...)name: mon-appcodeType: SpaLe deployer :
- Detecte le port expose par l’image Docker
- Cree un service ClusterIP
- Configure le DNS (
mon-api-{branch}.homeserve.io) - Genere les certificats TLS
- Configure l’Envoy Gateway avec CORS, timeouts, retries
2. Ajouter le workflow GitHub Actions
Section intitulée « 2. Ajouter le workflow GitHub Actions »name: CIon: push: workflow_dispatch:
jobs: ci: uses: HomeserveFR/devops-workflows/.github/workflows/deployer-reusable.yml@v2 with: command: 'deployer deploy' environment: staging environment_github: staging branch_slug: ${{ github.ref_name }} docker_image: 'mon-registry/mon-image:latest' secrets: inherit3. Pusher et deployer
Section intitulée « 3. Pusher et deployer »git add deployer.yaml .github/workflows/ci.yamlgit commit -m "feat: add deployer configuration"git pushLe pipeline va automatiquement deployer l’application. L’URL sera disponible dans les logs du job deploy.