Skip to content

Commit

Permalink
feat: Add ci/cd for capture-replay (#24604)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankh authored Aug 27, 2024
1 parent c50a791 commit b8dd904
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion .github/workflows/rust-docker-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build rust container images
name: Build and deploy rust container images

on:
workflow_dispatch:
Expand Down Expand Up @@ -28,6 +28,9 @@ jobs:
contents: read # allow reading the repo contents
packages: write # allow push to ghcr.io

outputs:
digest: ${{ steps.docker_build.outputs.digest }}

defaults:
run:
working-directory: rust
Expand Down Expand Up @@ -91,3 +94,36 @@ jobs:

- name: Container image digest
run: echo ${{ steps.docker_build.outputs.digest }}


deploy:
name: Deploy capture-replay
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
steps:
- name: get deployer token
id: deployer
uses: getsentry/action-github-app-token@v3
with:
app_id: ${{ secrets.DEPLOYER_APP_ID }}
private_key: ${{ secrets.DEPLOYER_APP_PRIVATE_KEY }}

- name: Trigger livestream deployment
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ steps.deployer.outputs.token }}
repository: PostHog/charts
event-type: commit_state_update
client-payload: |
{
"values": {
"image": {
"sha": "${{ needs.build.outputs.digest }}"
}
},
"release": "capture-replay",
"commit": ${{ toJson(github.event.head_commit) }},
"repository": ${{ toJson(github.repository) }},
"labels": []
}

0 comments on commit b8dd904

Please sign in to comment.