diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index bbdc952..c5c91f8 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -89,7 +89,7 @@ jobs: release: needs: test runs-on: ubuntu-latest - if: ${{ vars.RUN_CICD == 'true' && success() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/prod') && (vars.DEPLOY_DEV == 'true' || vars.DEPLOY_PROD == 'true') }} + if: ${{ vars.RUN_CICD == 'true' && success() && github.ref == 'refs/heads/main' && (vars.DEPLOY_DEV == 'true' || vars.DEPLOY_PROD == 'true') }} steps: - name: Clone repository uses: actions/checkout@v4 @@ -134,6 +134,11 @@ jobs: engine-announce-retries: ${{ env.DEV_ENGINE_ANNOUNCE_RETRIES }} engine-announce-retry-delay: ${{ env.DEV_ENGINE_ANNOUNCE_RETRY_DELAY }} + - name: Remove unnecessary keys from configuration files + uses: swiss-ai-center/common-code/.github/actions/remove-unnecessary-keys-from-kubernetes-configuration-files@main + with: + configuration-files-location: ./kubernetes + - name: Deploy service on the Kubernetes cluster uses: swiss-ai-center/common-code/.github/actions/execute-command-on-kubernetes-cluster@main with: @@ -150,7 +155,7 @@ jobs: deploy-prod: needs: release runs-on: ubuntu-latest - if: ${{ vars.RUN_CICD == 'true' && success() && github.ref == 'refs/heads/prod' && vars.DEPLOY_PROD == 'true' }} + if: ${{ vars.RUN_CICD == 'true' && success() && github.ref == 'refs/heads/main' && vars.DEPLOY_PROD == 'true' }} steps: - name: Clone repository uses: actions/checkout@v4 diff --git a/kubernetes/ingress.yml b/kubernetes/ingress.yml index fb2020a..22ce83a 100644 --- a/kubernetes/ingress.yml +++ b/kubernetes/ingress.yml @@ -3,14 +3,15 @@ kind: Ingress metadata: name: my-service-ingress annotations: + cert-manager.io/issuer: "letsencrypt" nginx.ingress.kubernetes.io/proxy-body-size: "16m" nginx.org/client-max-body-size: "16m" spec: rules: - - host: my-service.example.com - http: - paths: - - path: / + - host: my-service.example.com + http: + paths: + - path: / pathType: Prefix backend: service: @@ -19,4 +20,5 @@ spec: number: 80 tls: - hosts: - - my-service.example.com + - my-service.example.com + secretName: my-service-example-com-tls-cert