Skip to content

Commit

Permalink
Refactor deploy alerting temporal (#8766)
Browse files Browse the repository at this point in the history
* Refactor deploy alerting temporal

* ✨
  • Loading branch information
flvndvd authored Nov 19, 2024
1 parent 318ccc3 commit 8ffef3a
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 27 deletions.
70 changes: 52 additions & 18 deletions .github/workflows/deploy-alerting-temporal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,65 @@ jobs:
id: short_sha
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Notify Build And Deploy Start
id: build_message
uses: ./.github/actions/slack-notify
with:
step: "start"
component: "alerting-temporal"
image_tag: ${{ steps.short_sha.outputs.short_sha }}
channel: ${{ secrets.SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_BOT_TOKEN }}

- 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=alerting-temporal --dockerfile-path=./Dockerfile --working-dir=./alerting/temporal/ --dust-client-facing-url=https://dust.tt
./k8s/cloud-build.sh \
--image-name=alerting-temporal \
--dockerfile-path=./Dockerfile \
--working-dir=./alerting/temporal/ \
--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/alerting-temporal-image:${{ steps.short_sha.outputs.short_sha }} alerting-temporal-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: kubectl rollout status deployment/alerting-temporal-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: 'alerting-temporal',
image_tag: '${{ steps.short_sha.outputs.short_sha }}',
slack_thread_ts: "${{ steps.build_message.outputs.thread_ts }}",
slack_channel: '${{ secrets.SLACK_CHANNEL_ID }}'
}
});
- name: Notify Failure
if: failure()
uses: ./.github/actions/slack-notify
with:
step: "failure"
component: "alerting-temporal"
image_tag: ${{ steps.short_sha.outputs.short_sha }}
channel: ${{ secrets.SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_BOT_TOKEN }}
thread_ts: "${{ steps.build_message.outputs.thread_ts }}"
8 changes: 4 additions & 4 deletions .github/workflows/deploy-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ jobs:
run: |
chmod +x ./k8s/cloud-build.sh
./k8s/cloud-build.sh \
--image-name=core \
--dockerfile-path=./Dockerfile \
--working-dir=./core/ \
--dust-client-facing-url=https://dust.tt
--image-name=core \
--dockerfile-path=./Dockerfile \
--working-dir=./core/ \
--dust-client-facing-url=https://dust.tt
- name: Generate a token
id: generate-token
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/deploy-front.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ jobs:
- name: Build the image on Cloud Build
run: |
chmod +x ./k8s/cloud-build.sh
./k8s/cloud-build.sh --image-name=front --dockerfile-path=./front/Dockerfile --working-dir=./ --dust-client-facing-url=https://dust.tt
./k8s/cloud-build.sh \
--image-name=front \
--dockerfile-path=./front/Dockerfile \
--working-dir=./ \
--dust-client-facing-url=https://dust.tt
- name: Generate a token
id: generate-token
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy-oauth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ jobs:
run: |
chmod +x ./k8s/cloud-build.sh
./k8s/cloud-build.sh \
--image-name=oauth \
--dockerfile-path=./oauth.Dockerfile \
--working-dir=./core/ \
--dust-client-facing-url=https://dust.tt
--image-name=oauth \
--dockerfile-path=./oauth.Dockerfile \
--working-dir=./core/ \
--dust-client-facing-url=https://dust.tt
- name: Generate a token
id: generate-token
Expand Down

0 comments on commit 8ffef3a

Please sign in to comment.