Skip to content

Conversation

@Kiran1689
Copy link

@Kiran1689 Kiran1689 commented Oct 10, 2025

User description

Description

This agent automates the deployment of static websites to GitHub Pages, enabling seamless hosting directly from a GitHub repository. It handles repository setup, build detection, deployment branch management, and verification of a successful live site.

  • Initializes a new Git repository if one does not exist

  • Automatically creates a remote GitHub repository if missing

  • Commits and pushes project files to the main branch

  • Detects and runs build commands if applicable (npm run build, next build, etc.)

  • Determines which directory to deploy (auto-detects build, dist, out, or .next/out)

  • Creates and manages a gh-pages branch for static site deployment

  • Pushes the deployed content to GitHub Pages

  • Confirms the live deployment URL

  • Returns structured logs and URLs for both repository and deployed site

Demo and Testing

full demo of the agents action here👉 https://vimeo.com/1126271853


PR Type

Other


Description

  • Add GitHub Pages deployment automation agent

  • Includes repository setup and build detection

  • Manages deployment branch and verification

  • Provides comprehensive documentation and configuration


Diagram Walkthrough

flowchart LR
  A["Project Files"] --> B["Git Repository"]
  B --> C["Build Process"]
  C --> D["Deploy Directory"]
  D --> E["gh-pages Branch"]
  E --> F["GitHub Pages Site"]
Loading

File Walkthrough

Relevant files
Documentation
README.md
Complete documentation for GitHub Pages agent                       

agents/github-pages-deploy/README.md

  • Add comprehensive documentation with features and workflow
  • Include configuration options table and usage examples
  • Provide troubleshooting guide and output schema
  • Add demo video link and tool requirements
+140/-0 
Configuration changes
agent.toml
Agent configuration in TOML format                                             

agents/github-pages-deploy/agent.toml

  • Define agent configuration with deployment instructions
  • Specify required arguments for repo, build, and source directory
  • Configure tools for filesystem, git, and GitHub operations
  • Set output schema for deployment results
+53/-0   
agent.yaml
Agent configuration in YAML format                                             

agents/github-pages-deploy/agent.yaml

  • Mirror TOML configuration in YAML format
  • Define same deployment workflow and arguments
  • Specify identical tool requirements and output schema
  • Maintain consistency with TOML version
+72/-0   
mcp.json
MCP server configuration for deployment tools                       

agents/github-pages-deploy/mcp.json

  • Configure MCP servers for desktop-commander and GitHub
  • Set up authentication with GitHub personal access token
  • Define command execution parameters for deployment tools
+17/-0   

@qodo-free-for-open-source-projects
Copy link
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
Credential handling

Description: The MCP GitHub server configuration uses an Authorization header sourced from an
environment variable, which if committed with a real token or logged by the agent could
expose credentials; ensure tokens are strictly read from environment at runtime and never
persisted or printed.
mcp.json [11-15]

Referred Code
 "url": "https://api.githubcopilot.com/mcp/",
 "headers": {
 "Authorization": "Bearer ${GITHUB_PERSONAL_ACCESS_TOKEN}"
 }
}
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
No custom compliance provided

Follow the guide to enable custom compliance check.

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-free-for-open-source-projects
Copy link
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
High-level
Use GitHub Actions for deployment

Replace the custom deployment agent with a standard GitHub Actions workflow.
This change improves security by using temporary tokens instead of PATs,
increases robustness, and follows industry best practices for CI/CD on GitHub.

Examples:

agents/github-pages-deploy/agent.toml [6-31]
instructions = """
You are an automation agent responsible for deploying static sites to GitHub Pages.

Your goals:

1. Check if a `.git` folder exists. If not, initialize a new Git repository.
2. Verify if the remote GitHub repository exists; if not, create it.
3. Add and commit all project files to the `main` branch, excluding `node_modules`, `.env`, and build artifacts.
4. Push the `main` branch to the remote repository.
5. Detect if the project requires a build:

 ... (clipped 16 lines)

Solution Walkthrough:

Before:

# agent.toml (describing the agent's logic)

# 1. Manually initialize git, create remote repo.
# 2. Commit and push to main branch.
# 3. Run build command locally.
# 4. Determine build output directory.
# 5. Create a temporary `.deploy_temp` directory.
# 6. Manually switch to `gh-pages` branch.
# 7. Clean the branch, copy temp files.
# 8. Commit and push to `gh-pages`.
# 9. Clean up temp directory.
# Requires: A long-lived GITHUB_PERSONAL_ACCESS_TOKEN

After:

# .github/workflows/deploy.yml
name: Deploy to GitHub Pages
on:
  push:
    branches: [ main ]
jobs:
  deploy:
    runs-on: ubuntu-latest
    permissions:
      pages: write
      id-token: write
    steps:
      - uses: actions/checkout@v4
      - run: npm install && npm run build # Or other build command
      - uses: actions/upload-pages-artifact@v3
        with:
          path: './build' # Or other build output dir
      - uses: actions/deploy-pages@v4
Suggestion importance[1-10]: 10

__

Why: This is a critical architectural suggestion that proposes replacing the custom agent with a more secure, robust, and industry-standard GitHub Actions workflow, addressing fundamental design choices.

High
Possible issue
Use the correct GitHub API endpoint

Change the github tool's URL from the incorrect GitHub Copilot endpoint to the
correct GitHub REST API endpoint (https://api.github.com/) to enable proper
repository interactions.

agents/github-pages-deploy/mcp.json [11]

-"url": "https://api.githubcopilot.com/mcp/",
+"url": "https://api.github.com/",
  • Apply / Chat
Suggestion importance[1-10]: 10

__

Why: The suggestion correctly identifies a critical bug where the wrong GitHub API endpoint is used, which would cause all repository-related operations to fail and render the agent non-functional.

High
Security
Respect .gitignore to avoid committing secrets

Modify the agent's instructions to respect the project's .gitignore file when
committing files, preventing the accidental exposure of secrets or unwanted
files.

agents/github-pages-deploy/agent.toml [13]

-3. Add and commit all project files to the `main` branch, excluding `node_modules`, `.env`, and build artifacts.
+3. Add and commit all project files to the `main` branch, respecting the project's `.gitignore` file.
  • Apply / Chat
Suggestion importance[1-10]: 9

__

Why: The suggestion addresses a significant security risk by proposing to respect the .gitignore file, which prevents the accidental commitment of secrets and sensitive information.

High
  • More

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant