0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-22 08:40:03 +01:00

feat: use new deployment trigger for temporal worker deployments (#22668)

use new deployment trigger for temporal worker deployments

these trigger a new workflow in posthog/charts which creates a statefile
commit instead of deploying with manually set values from env vars.

the statefile commit then triggers a deploy - this means 100% of our
deployment state is codified, simplifying rollbacks and deploys
This commit is contained in:
Frank Hamand 2024-06-04 16:12:54 +01:00 committed by GitHub
parent 2dcef5cff9
commit 0834410018
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -120,17 +120,22 @@ jobs:
- name: Trigger Batch Exports Temporal Worker Cloud deployment
if: steps.check_changes_batch_exports_temporal_worker.outputs.changed == 'true'
uses: mvasigh/dispatch-action@main
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ steps.deployer.outputs.token }}
repo: charts
owner: PostHog
event_type: temporal_worker_deploy
message: |
repository: PostHog/charts
event-type: commit_state_update
client-payload: |
{
"image_tag": "${{ steps.build.outputs.digest }}",
"worker_name": "temporal-worker",
"context": ${{ toJson(github) }}
"values": {
"image": {
"sha": "${{ steps.build.outputs.digest }}"
}
},
"release": "temporal-worker",
"commit": ${{ toJson(github.event.head_commit) }},
"repository": ${{ toJson(github.repository) }},
"labels": ${{ steps.labels.outputs.labels }}
}
- name: Check for changes that affect general purpose temporal worker
@ -140,17 +145,22 @@ jobs:
- name: Trigger General Purpose Temporal Worker Cloud deployment
if: steps.check_changes_general_purpose_temporal_worker.outputs.changed == 'true'
uses: mvasigh/dispatch-action@main
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ steps.deployer.outputs.token }}
repo: charts
owner: PostHog
event_type: temporal_worker_deploy
message: |
repository: PostHog/charts
event-type: commit_state_update
client-payload: |
{
"image_tag": "${{ steps.build.outputs.digest }}",
"worker_name": "temporal-worker-general-purpose",
"context": ${{ toJson(github) }}
"values": {
"image": {
"sha": "${{ steps.build.outputs.digest }}"
}
},
"release": "temporal-worker-general-purpose",
"commit": ${{ toJson(github.event.head_commit) }},
"repository": ${{ toJson(github.repository) }},
"labels": ${{ steps.labels.outputs.labels }}
}
- name: Check for changes that affect data warehouse temporal worker
@ -160,15 +170,20 @@ jobs:
- name: Trigger Data Warehouse Temporal Worker Cloud deployment
if: steps.check_changes_data_warehouse_temporal_worker.outputs.changed == 'true'
uses: mvasigh/dispatch-action@main
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ steps.deployer.outputs.token }}
repo: charts
owner: PostHog
event_type: temporal_worker_deploy
message: |
repository: PostHog/charts
event-type: commit_state_update
client-payload: |
{
"image_tag": "${{ steps.build.outputs.digest }}",
"worker_name": "temporal-worker-data-warehouse",
"context": ${{ toJson(github) }}
"values": {
"image": {
"sha": "${{ steps.build.outputs.digest }}"
}
},
"release": "temporal-worker-data-warehouse",
"commit": ${{ toJson(github.event.head_commit) }},
"repository": ${{ toJson(github.repository) }},
"labels": ${{ steps.labels.outputs.labels }}
}