Skip to content

Commit

Permalink
Update viz GH deploy action (#8683)
Browse files Browse the repository at this point in the history
  • Loading branch information
flvndvd authored Nov 15, 2024
1 parent 3b4d9fe commit 73f7066
Showing 1 changed file with 29 additions and 17 deletions.
46 changes: 29 additions & 17 deletions .github/workflows/deploy-viz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,37 @@ jobs:
- 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=viz --dockerfile-path=./viz/Dockerfile --working-dir=./ --dust-client-facing-url=https://dust.tt
./k8s/cloud-build.sh \
--image-name=viz \
--dockerfile-path=./viz/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/viz-image:${{ steps.short_sha.outputs.short_sha }} viz-deployment
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.INFRA_DISPATCH_APP_ID }}
private-key: ${{ secrets.INFRA_DISPATCH_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: |
dust-infra
- name: Wait for rollout to complete
run: |
echo "Waiting for rollout to complete"
kubectl rollout status deployment/viz-deployment --timeout=10m
- name: Trigger dust-infra workflow
uses: actions/github-script@v6
with:
github-token: ${{ steps.generate-token.outputs.token }}
script: |
await github.rest.repos.createDispatchEvent({
owner: '${{ github.repository_owner }}',
repo: 'dust-infra',
event_type: 'trigger-component-deploy',
client_payload: {
regions: 'us-central1',
component: 'viz',
image_tag: '${{ steps.short_sha.outputs.short_sha }}'
}
});

0 comments on commit 73f7066

Please sign in to comment.