-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update GitHub deploy connectors action
- Loading branch information
Showing
1 changed file
with
26 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: "[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 |