Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[.github] - infra: new connectors deploy workflow #8661

Merged
merged 4 commits into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/deploy-connectors-infra.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Deploy Infra

on:
workflow_dispatch:
inputs:
us-central1:
description: "Deploy to us-central1"
type: boolean
default: true

concurrency:
group: deploy_infra
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: 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: 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 }}

- name: Trigger dust-infra workflow
uses: actions/github-script@v6
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
with:
github-token: ${{ env.GH_TOKEN }}
script: |
await github.rest.repos.createDispatchEvent({
owner: 'dust-tt',
repo: 'dust-infra',
event_type: 'trigger-component-deploy',
client_payload: {
us_central1: ${{ inputs.us-central1 }},
component: 'connectors',
image_tag: '${{ steps.short_sha.outputs.short_sha }}'
}
});
Loading