Deploy Connectors #1172
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Connectors | |
on: | |
workflow_dispatch: | |
concurrency: | |
group: deploy_connectors | |
cancel-in-progress: false | |
env: | |
GCLOUD_PROJECT_ID: ${{ secrets.GCLOUD_PROJECT_ID }} | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Get short sha | |
id: short_sha | |
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: "Authenticate with Google Cloud" | |
uses: "google-github-actions/auth@v1" | |
with: | |
credentials_json: "${{ secrets.GCLOUD_SA_KEY }}" | |
- name: "Set up Cloud SDK" | |
uses: "google-github-actions/setup-gcloud@v1" | |
- name: Install gke-gcloud-auth-plugin | |
run: | | |
gcloud components install gke-gcloud-auth-plugin | |
- name: Setup kubectl | |
run: | | |
gcloud container clusters get-credentials dust-kube --region us-central1 | |
- name: Build the image on Cloud Build | |
run: | | |
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 | |
- 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: Wait for rollout to complete | |
run: | | |
echo "Waiting for rollout to complete (web)" | |
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 |