diff --git a/.github/workflows/change-values.yml b/.github/workflows/change-values.yml index 5f266678..c789ac04 100644 --- a/.github/workflows/change-values.yml +++ b/.github/workflows/change-values.yml @@ -11,6 +11,11 @@ on: type: string description: "Namespace name in kubernetes cluster" default: "basegun" + domain: + required: true + type: string + description: "Nom de domaine utilisé par l'application" + default: "basegun.fr" branch: required: true type: string @@ -68,9 +73,14 @@ jobs: - name: Update Infra Version run: | - export TAG=$(make get-current-tag) - yq -i '.backend.image.tag = strenv(TAG)' ./infra/kube/basegun/values.yaml - yq -i '.frontend.image.tag = strenv(TAG)' ./infra/kube/basegun/values.yaml + export TAG=$(make get-current-tag) + yq -i '.backend.image.tag = strenv(TAG)' ./infra/kube/helm/values.yaml + yq -i '.frontend.image.tag = strenv(TAG)' ./infra/kube/helm/values.yaml + + - name: Update ingress domaine + run: | + export DOMAIN="${{ inputs.domain }}" + yq -i '.ingress.hosts[0].host = strenv(DOMAIN)' ./infra/kube/helm/values.yaml - name: Commit and push changes uses: devops-infra/action-commit-push@v0.3 diff --git a/.github/workflows/preprod.yml b/.github/workflows/preprod.yml index 7c54377c..593b0156 100644 --- a/.github/workflows/preprod.yml +++ b/.github/workflows/preprod.yml @@ -31,7 +31,7 @@ jobs: organization: datalab-mi container: basegun/basegun-backend dry-run: false - untagged: true + prune-untagged: true - name: Delete untagged images uses: vlaurin/action-ghcr-prune@main with: @@ -39,25 +39,23 @@ jobs: organization: datalab-mi container: basegun/basegun-frontend dry-run: false - untagged: true + prune-untagged: true deploy-preprod: - uses: ./.github/workflows/deploy.yml + uses: ./.github/workflows/change-values.yml needs: build-push with: - image_version: "develop" branch: ${{ github.ref_name }} - volume_size: 10 - flavor: "s1-2" - workspace: "preprod" + namespace: basegun-preprod + domain: preprod.basegun.fr secrets: API_OVH_TOKEN: ${{ secrets.API_OVH_TOKEN }} - SERVER_IP: ${{ secrets.PREPROD_SERVER_IP }} OS_PASSWORD: ${{ secrets.OS_PASSWORD }} - OS_PROJECT_ID: ${{ secrets.OS_PROJECT_ID }} OS_PROJECT_NAME: ${{ secrets.OS_PROJECT_NAME }} OS_USERNAME: ${{ secrets.OS_USERNAME }} X_OVH_TOKEN: ${{ secrets.PREPROD_OVH_TOKEN }} + JOB_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + KUBECONFIG: ${{ secrets.PREPROD_K8_CONFIG }} test: runs-on: ubuntu-latest diff --git a/infra/kube/helm/values.yaml b/infra/kube/helm/values.yaml index e6c5c4f1..2a603f0f 100644 --- a/infra/kube/helm/values.yaml +++ b/infra/kube/helm/values.yaml @@ -11,7 +11,7 @@ ingress: #traefik.ingress.kubernetes.io/router.tls: "true" #traefik.ingress.kubernetes.io/router.tls.certresolver: letsencrypt hosts: - - host: kube.basegun.fr + - host: preprod.basegun.fr paths: - path: / pathType: Prefix @@ -34,7 +34,7 @@ backend: repository: ghcr.io/datalab-mi/basegun/basegun-backend pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: "2.0" + tag: "3.0" imagePullSecrets: [] podAnnotations: {} podSecurityContext: {} @@ -96,7 +96,7 @@ frontend: repository: ghcr.io/datalab-mi/basegun/basegun-frontend pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: "2.0" + tag: "3.0" imagePullSecrets: [] podAnnotations: {} podSecurityContext: {}