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
chore(ci/cd): switch deployment action #13545
Conversation
9db4085
to
c8e0962
Compare
name: E2E CI | ||
|
||
on: | ||
pull_request: | ||
push: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not need to run this on master
anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's still sensible to run the tests on master - two branches may pass tests individually, but when both merged they may cause a failure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's still sensible to run the tests on master - two branches may pass tests individually, but when both merged they may cause a failure
I agree and I'm 👍 to change this. I just want to point out that this PR didn't change the previous behaviour as the Cypress E2E tests matrix was only running on non-master
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh ok sure, makes sense then 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A CI failure will anyway not block the deployment, is it ok for you?
run: echo "specs=$(ls cypress/e2e/* | jq --slurp --raw-input -c 'split("\n")[:-1] | _nwise(3) | join("\n")' | jq --slurp -c .)" >> $GITHUB_OUTPUT | ||
|
||
cypress: | ||
name: Cypress E2E tests (${{ strategy.job-index }}) | ||
if: ${{ github.ref != 'refs/heads/master' }} # Don't run on master, we only care about node_modules cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not necessary anymore as we do not run on master
@@ -13,7 +13,6 @@ on: | |||
push: | |||
branches: | |||
- master | |||
- main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is coming from a great suggestion from @hazzadous: as we only have branch protection enabled on master
, let's do not use main
till we officially switch to it.
@@ -118,3 +117,23 @@ jobs: | |||
# the posthog-cloud code we've checked out. | |||
build-args: | | |||
BASE_IMAGE=posthog/posthog:latest | |||
|
|||
- name: Trigger PostHog Cloud deployment | |||
# TODO: switch to https://github.com/marketplace/actions/repository-dispatch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't change the action directly in this PR as there's likely a little dance that needs to happen between this repo and posthog-cloud-infra
as the action output changes a bit.
Sorry @hazzadous but I had to fix a merge conflict. The conflict was a 1 liner |
Changes
remove all the container build logic that was present in
.github/workflows/ci-e2e.yml
as we now have dedicated workflows for it.move the
Trigger PostHog Cloud deployment
step from.github/workflows/ci-e2e.yml
to.github/workflows/container-images-cd.yml
.make the E2E CI Cypress tests pull the container image from the GitHub container registry instead of rebuilding it.
How did you test this code?
CI should be ✅ for
.github/workflows/ci-e2e.yml
..github/workflows/container-images-cd.yml
only runs onmaster
so I didn't test it but it's more or less a copy paste of what we had already.