Github deployments are webhook events triggered by Github whenever a deployment service reports a successful deployment event. This works out-of-the-box with the following services.
Any (SaaS) service that interacts with the Github deployments API and reports the correct “success” message will work.
Setting up your Github integration
Go to the integrations tab in your account settings and click the “Integrate with Github” button.
You will be redirected to Github and prompted to select an account and install the Checkly Github App.
When accepting the installation, you are redirected back to Checkly and the integration is installed. Now, go to the CI/CD tab of the check you want to link to a Github repository.
Click the “Link Github repo” button and select the repository you want to link.
On each deployment event, we will run your check and report the results directly in your Github timeline and PR overview.
You will also get an overview of the check result in the details section
Using environment URL’s
Github reports a environment URL on each deployment event. Depending on what deployment service you use, this environment URL can be used to run your check on different target environments than configured in your check.
The primary use case for this is that temporary review/branch deployments such as provided by Zeit and Heroku Pipelines can be validated before going to production.
So, when you enable the “Use environment URL from deployment trigger” checkbox there are two scenarios:
API checks & environment URL’s
With API checks, we replace the hostname part of your request url with the host in the environment URL. For example:
- Your configured URL:
- Environment URL:
- Replaced URL:
Notice we only replace the host part, not the URL path or any query parameters.
Browser checks & environment URL’s
For browser checks, the environment URL is exposed as the
ENVIRONMENT_URL environment variable. This means you can use that
variable in your code to replace any hardcoded URL you might have, i.e.
const puppeteer = require("puppeteer"); const browser = await puppeteer.launch(); const page = await browser.newPage(); const myURL = process.env.ENVIRONMENT_URL || 'https://acme.com' await page.goto(myURL); await browser.close();
Last updated on October 2, 2019