Skip to content

Commit

Permalink
Update GitHub deploy connectors action
Browse files Browse the repository at this point in the history
  • Loading branch information
flvndvd committed Nov 14, 2024
1 parent 31949e9 commit 7be1e2c
Showing 1 changed file with 26 additions and 16 deletions.
42 changes: 26 additions & 16 deletions .github/workflows/deploy-connectors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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: "[email protected]"

- name: Configure gcloud credentials
run: gcloud auth configure-docker us-central1-docker.pkg.dev

- name: Setup Helm and Helmfile
uses: helmfile/[email protected]
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

0 comments on commit 7be1e2c

Please sign in to comment.