Skip to content

Commit ab2628f

Browse files
Document Checkly GitHub Action workflows (#445)
* Document Checkly GitHub Action workflows * Use GitHub variables for Checkly account IDs * Clarify GitHub App installation path * Clarify GitHub deployment hook workflow * Refresh GitHub integration guides * Align GitHub Action docs with v1.1 * Clarify merge queue Check reporting * Keep GitHub Action guide product-focused
1 parent 9676533 commit ab2628f

10 files changed

Lines changed: 244 additions & 150 deletions

File tree

-42.1 KB
Binary file not shown.
-69.7 KB
Binary file not shown.
-125 KB
Binary file not shown.
-155 KB
Binary file not shown.
-75.2 KB
Binary file not shown.
-61.6 KB
Binary file not shown.

integrations/ci-cd/github/actions.mdx

Lines changed: 207 additions & 111 deletions
Large diffs are not rendered by default.
Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,46 @@
11
---
2-
title: Integrating Checkly in GitHub Deployments
3-
description: "Trigger Checkly checks from GitHub deployment events fired by services like Vercel and Heroku, running against both preview and production deployments."
4-
sidebarTitle: GitHub Deployments
2+
title: GitHub deployment hooks
3+
description: "Trigger linked Checkly checks from GitHub deployment events and use deployment environment URLs as test targets."
4+
sidebarTitle: Deployment hooks
55
canonical: 'https://www.checklyhq.com/docs/integrations/ci-cd/github/deployments/'
66
---
77

8+
Use GitHub deployment hooks when you want Checkly to listen for GitHub `deployment_status` events and trigger checks linked to a repository. This is separate from the [Checkly GitHub Action](/integrations/ci-cd/github/actions), which starts test sessions from a GitHub Actions workflow.
89

9-
GitHub deployments are webhook events triggered by GitHub whenever a deployment service reports a successful deployment
10-
event. This works out-of-the-box with the following services.
11-
12-
- [Vercel for GitHub](https://vercel.com/docs/v2/git-integrations/vercel-for-github)
13-
- [Heroku Pipelines](https://devcenter.heroku.com/articles/pipelines)
14-
15-
Any (SaaS) service that interacts with the [GitHub deployments API](https://developer.github.com/v3/repos/deployments/) and
16-
reports the correct "success" message will work, both with production and preview deployments.
10+
<Accordion title="Prerequisites">
11+
- The Checkly GitHub integration installed from the [Account settings > Integrations](https://app.checklyhq.com/settings/account/integrations) page of the Checkly account that owns the checks.
12+
- A deployment provider that sends successful GitHub `deployment_status` events, such as Vercel for GitHub or Heroku Pipelines.
13+
- One or more Checkly checks linked to the GitHub repository from the check's **CI/CD** settings.
14+
</Accordion>
1715

1816
<Warning>
19-
This integration has some [known limitations](/integrations/ci-cd/github/deployments#limitations). We recommend using the [Checkly CLI](/cli/overview) in your CI/CD pipeline instead.
17+
Start the installation from [Account settings > Integrations](https://app.checklyhq.com/settings/account/integrations) in Checkly and click **Integrate with GitHub**. Grant the installation access to the repository you want to link. Installing the app directly from GitHub does not connect it to the Checkly account, so deployment hooks and GitHub Check reporting will not work correctly.
2018
</Warning>
2119

22-
## Setting up your GitHub integration
20+
GitHub `deployment_status` webhook events are triggered whenever a deployment service reports a successful deployment. This works with services that report successful deployment statuses through the GitHub Deployments API, including:
2321

24-
1. Go to the **integrations tab** in your account settings and click the "Integrate with GitHub" button.
25-
![set up GitHub integration step 1](/images/docs/images/cicd/github_setup_1.png)
22+
- [Vercel for GitHub](https://vercel.com/docs/v2/git-integrations/vercel-for-github)
23+
- [Heroku Pipelines](https://devcenter.heroku.com/articles/pipelines)
24+
- Other deployment services that use the [GitHub deployments API](https://docs.github.com/en/rest/deployments/deployments) and report successful deployment statuses.
2625

27-
2. You will be redirected to GitHub and prompted to select an account and install the Checkly GitHub App.
28-
![set up GitHub integration step 2](/images/docs/images/cicd/github_setup_2.png)
26+
<Warning>
27+
This integration has some [known limitations](/integrations/ci-cd/github/deployments#limitations). Use the [Checkly GitHub Action](/integrations/ci-cd/github/actions) when you want GitHub Actions to start a recorded test session and report the result on a pull request.
28+
</Warning>
2929

30-
3. When accepting the installation, you are redirected back to Checkly and the integration is installed.
31-
Now, go to the **CI/CD tab** of the check you want to link to a GitHub repository. In Browser checks, this will be under "Change settings".
32-
![set up GitHub integration step 3](/images/docs/images/cicd/github_setup_3.png)
30+
## Set up GitHub deployment hooks
3331

34-
4. Click the **"Link GitHub repo"** button and select the repository you want to link.
35-
![set up GitHub integration step 4](/images/docs/images/cicd/github_setup_4.png)
32+
1. Go to [Account settings > Integrations](https://app.checklyhq.com/settings/account/integrations) and click **Integrate with GitHub**.
33+
2. In GitHub, choose the account where you want to install the Checkly GitHub App and grant it access to the repositories you want to connect. After installation, GitHub redirects you to Checkly.
34+
3. Open the check or check group you want to trigger and go to its **CI/CD** settings.
35+
4. Click **Link GitHub repo** and select the repository that reports your deployment events.
3636

37-
5. On each deployment event, we will run your check and report the results directly in **your GitHub timeline and PR overview**.
38-
![set up GitHub integration step 5](/images/docs/images/cicd/github_setup_5.png)
37+
After you link the repository, Checkly listens for successful deployment events and runs the linked check or check group. You can also choose a run location, filter deployments by environment or environment URL, and include screenshots in the pull request comment.
3938

40-
6. You will also get an overview of the check result in the *details* section
41-
![set up GitHub integration step 6](/images/docs/images/cicd/github_setup_6.png)
42-
43-
> You can hook up multiple checks to the same repo. We will just run all of them as a test suite.
39+
<Note>
40+
You can link multiple checks to the same repository. Checkly runs the linked checks as a test suite when GitHub reports a successful deployment.
41+
</Note>
4442

45-
## Using environment URLs
43+
## Use deployment environment URLs
4644

4745
GitHub reports an **environment URL** on each deployment event. Depending on what deployment service you use,
4846
this environment URL can be used to run your check on different target environments than configured in your check.
@@ -54,7 +52,7 @@ So, when you enable the **"Use environment URL from deployment trigger"** checkb
5452

5553
### API checks & environment URLs
5654

57-
With API checks, we replace the hostname part of your request url with the host in the environment URL.
55+
With API checks, Checkly replaces the hostname part of your request URL with the host in the environment URL.
5856
For example:
5957

6058
- Your configured URL: `https://api.acme.com/v1/customers?page=1`
@@ -68,7 +66,7 @@ Notice we only replace the **host** part, not the URL path or any query paramete
6866
For browser checks, the environment URL is exposed as the `ENVIRONMENT_URL` environment variable. This means you can use that
6967
variable in your code to replace any hardcoded URL you might have, i.e.:
7068

71-
<CodeGroup dropdown>
69+
<CodeGroup dropdown={true}>
7270
```typescript test.spec.ts
7371
import { expect, test } from '@playwright/test'
7472

@@ -92,18 +90,18 @@ test('assert response status of page', async ({ page }) => {
9290
```
9391
</CodeGroup>
9492

95-
This way we are setting the `targetUrl` variable to either the `ENVIRONMENT_URL` or just our main production URL.
93+
This sets the `targetUrl` variable to either the `ENVIRONMENT_URL` or your main production URL.
9694

97-
Whenever a **Preview** deploy happens on GitHub, this check gets called and runs the script against the preview environment. This check also runs on a set interval, and checks our production environment.
95+
When a **Preview** deployment happens on GitHub, this check runs the script against the preview environment. This check also runs on a set interval and checks your production environment.
9896

99-
This way, we kill two birds with one stone and don't need separate checks for separate environments.
97+
With one check, you can validate preview deployments from GitHub events and keep running the same check on your production schedule.
10098

10199
## Limitations
102100

103-
GitHub deployments lacks support for several features:
101+
GitHub deployment hooks lack support for several features:
104102

105103
* Client certificates are not applied.
106104
* OpenTelemetry integration headers are not applied.
107105
* Private locations are not available.
108106

109-
As an alternative, we recommend using the [Checkly CLI](/cli/overview) in your CI/CD pipeline. The CLI is much more powerful and fully supported.
107+
Use the [Checkly GitHub Action](/integrations/ci-cd/github/actions) or the [Checkly CLI](/cli/overview) in your CI/CD pipeline when you need these features.

integrations/ci-cd/overview.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The preferred and most flexible way to integrate Checkly with your CI/CD is thro
2626
## CI/CD Integration using vendor webhooks
2727

2828
- [Vercel](/integrations/ci-cd/vercel/overview)
29-
- [GitHub deployments](/integrations/ci-cd/github/deployments)
29+
- [GitHub deployment hooks](/integrations/ci-cd/github/deployments)
3030

3131
## CI/CD Basics
3232
We've optimized the [Checkly CLI](/cli/overview) to work in any CI/CD workflow. Here are the basics you need to know that
@@ -41,4 +41,4 @@ in your CI/CD platform.
4141
The CLI will attempt to parse `git` specific information from the environment to display in the test session as metadata.
4242
You can also set these data items specifically by using environment variables.
4343

44-
<CliEnvVars />
44+
<CliEnvVars />

snippets/main-cicd-cards.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
icon="/images/github-icon-dark.svg"
55
href="/integrations/ci-cd/github/actions"
66
>
7-
Run the Checkly CLI from GitHub Actions, export summary reports and integrate with mono repos
7+
Run Checkly test sessions from GitHub Actions and report results in pull requests.
88
</Card>
99
<Card
1010
title="GitLab CI"

0 commit comments

Comments
 (0)