Open Context Protocol is live! 🚀 Read the launch post
reposCreatePagesDeployment

reposCreatePagesDeployment

Create a GitHub Pages deployment

Details

  • Method: POST
  • Path: /repos/{owner}/{repo}/pages/deployments
  • Operation ID: repos/create-pages-deployment

Parameters

{
  "owner": {
    "description": "The account owner of the repository. The name is not case sensitive.",
    "required": true,
    "location": "path",
    "type": "string"
  },
  "repo": {
    "description": "The name of the repository without the `.git` extension. The name is not case sensitive.",
    "required": true,
    "location": "path",
    "type": "string"
  },
  "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.",
    "required": false,
    "location": "body",
    "type": "number"
  },
  "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.",
    "required": false,
    "location": "body",
    "type": "string"
  },
  "environment": {
    "description": "The target environment for this GitHub Pages deployment.",
    "required": false,
    "location": "body",
    "type": "string"
  },
  "pages_build_version": {
    "description": "A unique string that represents the version of the build for this deployment.",
    "required": true,
    "location": "body",
    "type": "string"
  },
  "oidc_token": {
    "description": "The OIDC token issued by GitHub Actions certifying the origin of the deployment.",
    "required": true,
    "location": "body",
    "type": "string"
  }
}

Response Schema

{
  "title": "GitHub Pages",
  "description": "The GitHub Pages deployment status.",
  "type": "object",
  "properties": {
    "id": {
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "string"
        }
      ],
      "description": "The ID of the GitHub Pages deployment. This is the Git SHA of the deployed commit."
    },
    "status_url": {
      "type": "string",
      "description": "The URI to monitor GitHub Pages deployment status.",
      "format": "uri",
      "example": "https://api.github.com/repos/github/hello-world/pages/deployments/4fd754f7e594640989b406850d0bc8f06a121251"
    },
    "page_url": {
      "type": "string",
      "description": "The URI to the deployed GitHub Pages.",
      "format": "uri",
      "example": "hello-world.github.io"
    },
    "preview_url": {
      "type": "string",
      "description": "The URI to the deployed GitHub Pages preview.",
      "format": "uri",
      "example": "monalisa-1231a2312sa32-23sda74.drafts.github.io"
    }
  },
  "required": [
    "id",
    "status_url",
    "page_url"
  ]
}

Usage

from ocp_agent import OCPAgent

agent = OCPAgent()
await agent.register_api('github')

# Call this tool
result = await agent.call_tool('reposCreatePagesDeployment', {
    # Add required parameters here
})