page_builds
Creates, updates, deletes, gets or lists a page_builds resource.
Overview
| Name | page_builds |
| Type | Resource |
| Id | github.repos.page_builds |
Fields
The following fields are returned by SELECT queries:
- get_pages_build
- list_pages_builds
Response
| Name | Datatype | Description |
|---|---|---|
commit | string | |
created_at | string (date-time) | |
duration | integer | |
error | object | |
pusher | object | A GitHub user. (title: Simple User) |
status | string | |
updated_at | string (date-time) | |
url | string (uri) |
Response
| Name | Datatype | Description |
|---|---|---|
commit | string | |
created_at | string (date-time) | |
duration | integer | |
error | object | |
pusher | object | A GitHub user. (title: Simple User) |
status | string | |
updated_at | string (date-time) | |
url | string (uri) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_pages_build | select | owner, repo, build_id | Gets information about a GitHub Pages build. OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint. | |
list_pages_builds | select | owner, repo | per_page, page | Lists builts of a GitHub Pages site. OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint. |
create_pages_deployment | insert | owner, repo, pages_build_version, oidc_token | Create a GitHub Pages deployment for a repository. The authenticated user must have write permission to the repository. | |
request_pages_build | exec | owner, repo | You can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures. Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
build_id | integer | |
owner | string | The account owner of the repository. The name is not case sensitive. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
page | integer | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
per_page | integer | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
SELECT examples
- get_pages_build
- list_pages_builds
Gets information about a GitHub Pages build.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
SELECT
commit,
created_at,
duration,
error,
pusher,
status,
updated_at,
url
FROM github.repos.page_builds
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND build_id = '{{ build_id }}' -- required
;
Lists builts of a GitHub Pages site.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
SELECT
commit,
created_at,
duration,
error,
pusher,
status,
updated_at,
url
FROM github.repos.page_builds
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
INSERT examples
- create_pages_deployment
- Manifest
Create a GitHub Pages deployment for a repository.
The authenticated user must have write permission to the repository.
INSERT INTO github.repos.page_builds (
artifact_id,
artifact_url,
environment,
pages_build_version,
oidc_token,
owner,
repo
)
SELECT
{{ artifact_id }},
'{{ artifact_url }}',
'{{ environment }}',
'{{ pages_build_version }}' /* required */,
'{{ oidc_token }}' /* required */,
'{{ owner }}',
'{{ repo }}'
RETURNING
id,
page_url,
preview_url,
status_url
;
# Description fields are for documentation purposes
- name: page_builds
props:
- name: owner
value: "{{ owner }}"
description: Required parameter for the page_builds resource.
- name: repo
value: "{{ repo }}"
description: Required parameter for the page_builds resource.
- name: artifact_id
value: {{ artifact_id }}
description: |
The ID of an artifact that contains the .zip or .tar of static assets to deploy. The artifact belongs to the repository. Either `artifact_id` or `artifact_url` are required.
- name: artifact_url
value: "{{ artifact_url }}"
description: |
The URL of an artifact that contains the .zip or .tar of static assets to deploy. The artifact belongs to the repository. Either `artifact_id` or `artifact_url` are required.
- name: environment
value: "{{ environment }}"
description: |
The target environment for this GitHub Pages deployment.
default: github-pages
- name: pages_build_version
value: "{{ pages_build_version }}"
description: |
A unique string that represents the version of the build for this deployment.
default: GITHUB_SHA
- name: oidc_token
value: "{{ oidc_token }}"
description: |
The OIDC token issued by GitHub Actions certifying the origin of the deployment.
Lifecycle Methods
- request_pages_build
You can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures.
Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes.
EXEC github.repos.page_builds.request_pages_build
@owner='{{ owner }}' --required,
@repo='{{ repo }}' --required
;