diff --git a/.github/workflows/deploy-connectors.yml b/.github/workflows/deploy-connectors.yml index 54cd00ad610f..de7e2c667a1d 100644 --- a/.github/workflows/deploy-connectors.yml +++ b/.github/workflows/deploy-connectors.yml @@ -12,6 +12,10 @@ env: jobs: build-and-deploy: + permissions: + contents: read + id-token: write + runs-on: ubuntu-latest if: github.ref == 'refs/heads/main' @@ -45,28 +49,34 @@ jobs: chmod +x ./k8s/cloud-build.sh ./k8s/cloud-build.sh --image-name=connectors --dockerfile-path=./connectors/Dockerfile --working-dir=./ --dust-client-facing-url=https://dust.tt + - id: "auth" + name: "Authenticate to Google Cloud" + uses: "google-github-actions/auth@v1" + with: + create_credentials_file: true + workload_identity_provider: "projects/357744735673/locations/global/workloadIdentityPools/github-pool/providers/github-provider" + service_account: "gh-charts-cd@dust-infra.iam.gserviceaccount.com" + + - name: Configure gcloud credentials + run: gcloud auth configure-docker us-central1-docker.pkg.dev + + - name: Setup Helm and Helmfile + uses: helmfile/helmfile-action@v1.0.0 + with: + helmfile-args: --version # Just to verify installation + - name: Deploy the image on Kubernetes run: | chmod +x ./k8s/deploy-image.sh ./k8s/deploy-image.sh gcr.io/$GCLOUD_PROJECT_ID/connectors-image:${{ steps.short_sha.outputs.short_sha }} connectors-deployment - ./k8s/deploy-image.sh gcr.io/$GCLOUD_PROJECT_ID/connectors-image:${{ steps.short_sha.outputs.short_sha }} connectors-worker-deployment - ./k8s/deploy-image.sh gcr.io/$GCLOUD_PROJECT_ID/connectors-image:${{ steps.short_sha.outputs.short_sha }} connectors-worker-notion-deployment - ./k8s/deploy-image.sh gcr.io/$GCLOUD_PROJECT_ID/connectors-image:${{ steps.short_sha.outputs.short_sha }} connectors-worker-notion-gc-deployment - ./k8s/deploy-image.sh gcr.io/$GCLOUD_PROJECT_ID/connectors-image:${{ steps.short_sha.outputs.short_sha }} connectors-worker-webcrawler-deployment - ./k8s/deploy-image.sh gcr.io/$GCLOUD_PROJECT_ID/connectors-image:${{ steps.short_sha.outputs.short_sha }} connectors-worker-google-drive-deployment + + - name: Deploy with Helmfile + run: | + helmfile diff --set connectors.image.tag=${{ steps.short_sha.outputs.short_sha }} + helmfile apply --set connectors.image.tag=${{ steps.short_sha.outputs.short_sha }} --wait --timeout 600s - name: Wait for rollout to complete run: | - echo "Waiting for rollout to complete (web)" + echo "Waiting for rollout to complete" kubectl rollout status deployment/connectors-deployment --timeout=10m - echo "Waiting for rollout to complete (worker)" - kubectl rollout status deployment/connectors-worker-deployment --timeout=10m - echo "Waiting for rollout to complete (notion worker)" - kubectl rollout status deployment/connectors-worker-notion-deployment --timeout=10m - echo "Waiting for rollout to complete (notion GC worker)" - kubectl rollout status deployment/connectors-worker-notion-gc-deployment --timeout=10m - echo "Waiting for rollout to complete (webcrawler worker)" - kubectl rollout status deployment/connectors-worker-webcrawler-deployment --timeout=10m - echo "Waiting for rollout to complete (google_drive worker)" - kubectl rollout status deployment/connectors-worker-google-drive-deployment --timeout=10m