digitalocean/static-site-agent
Python
Captured source
source ↗digitalocean/static-site-agent
Description: hacking...
Language: Python
License: MIT
Stars: 1
Forks: 0
Open issues: 0
Created: 2026-01-23T15:08:56Z
Pushed: 2026-02-20T22:02:16Z
Default branch: main
Fork: no
Archived: no
README:
Static Site Agent
An A2A (Agent-to-Agent) compliant agent that generates, containerizes, and deploys static websites to DigitalOcean Spaces.

Features
- AI-Powered Site Generation: Generate static websites based on natural language descriptions
- Customized Designs on the Fly: When you describe what you want, the agent creates a tailored multi-page site with relevant copy and images (no fixed template)
- Images & Copy: Sites include placeholder images keyed to your concept; if you don’t provide text, the AI generates relevant copy for the site type and concept
- Multiple Pages: Sites can have several pages (e.g. Home, About, Contact, Services); the generator chooses structure from your request
- Multiple Site Types: Supports portfolio, landing page, blog, and business sites
- Style Customization: Apply style hints like "modern and minimalist", "colorful and playful", or "professional"
- Automatic Containerization: Creates Docker containers for your generated sites
- DigitalOcean Spaces Deployment: Uploads the generated site directly to your DigitalOcean Space (creates the bucket if needed and saves the site so it can be served publicly)
- List Existing Sites: List all Spaces buckets (sites) in your account
- Edit Existing Sites: Download a site from a Space, edit it (e.g. change copy or styles), and save it back to the same bucket
Quick Deploy
Click the button above to deploy this agent directly to DigitalOcean App Platform. You'll need to: 1. Connect your GitHub account and fork this repository 2. Configure the required environment variables:
DO_GRADIENT_API_KEYorOPENAI_API_KEY(for AI site generation)SPACES_ACCESS_KEY_IDandSPACES_SECRET_ACCESS_KEY(for uploading sites to your DigitalOcean Space)
Local Deploy (no GitHub)
If you prefer deploying from your local machine without GitHub, use a container image and doctl:
1. Build the image locally:
docker build -t static-site-agent:latest .
2. Push the image to a registry (choose one):
- Docker Hub (public):
docker tag static-site-agent:latest docker.io//static-site-agent:latest docker push docker.io//static-site-agent:latest
- DigitalOcean Container Registry:
doctl registry create # if you don't have one doctl registry login docker tag static-site-agent:latest registry.digitalocean.com//static-site-agent:latest docker push registry.digitalocean.com//static-site-agent:latest
3. Update the image in .do/deploy.template.yaml to match your pushed image.
4. Create the app using doctl:
doctl auth switch --context doctl apps create --spec .do/deploy.template.yaml
This path avoids GitHub permissions entirely by deploying from your own container image.
Prerequisites
- Docker and Docker Compose installed (for local development)
- OpenAI API key OR DigitalOcean Gradient AI model access key
- Spaces access keys (for deploying generated sites to your Space; create under API → Spaces Keys)
- Docker network named
agents-net(create with:docker network create agents-net)
Setup
1. Clone the repository and navigate to the static-site-agent directory:
cd static-site-agent
2. Set your environment variables so the container can create buckets and upload to Spaces (choose one):
Option A: Using a `.env` file (recommended for Docker) Copy .env.example to .env and fill in your keys. Docker Compose loads .env automatically when you run docker compose up.
cp .env.example .env # Edit .env with your DO_GRADIENT_API_KEY or OPENAI_API_KEY and SPACES_* keys
Option B: Export in your shell
export DO_GRADIENT_API_KEY="your-do-model-access-key" export SPACES_ACCESS_KEY_ID="your-spaces-access-key" export SPACES_SECRET_ACCESS_KEY="your-spaces-secret-key" # Or use OPENAI_API_KEY instead of DO_GRADIENT_API_KEY for OpenAI
Spaces keys are created in the DigitalOcean control panel under API → Spaces Keys. The agent can create the Space (bucket) automatically if it doesn't exist.
3. Build and run the agent:
docker-compose up --build
The agent will be available at http://localhost:5002 with a built-in chat interface!
Usage
Using the Built-in Chat Interface (Recommended)
1. Open your browser to http://localhost:5002 2. You'll see a beautiful chat interface ready to use 3. Type your request or click one of the suggested prompts 4. The agent will generate, containerize, and help deploy your site!
Example Prompts
Example 1: Simple Portfolio
Create a modern minimalist portfolio site for a web developer
Example 2: Landing Page
Generate a colorful and playful landing page for a kids' app with a signup form
Example 3: Blog
Build a professional blog site with a dark theme
Example 4: Custom Multi-Page Site with Images
Create a photographer portfolio with a home page, about page, and contact page. Use a dark, elegant style.
Example 5: Deploy to Spaces (saves site to your Space)
Create a landing page and upload it to my DigitalOcean Space named my-website in nyc3
How It Works
The agent uses three main tools:
1. generate_static_site: Creates HTML/CSS files in a temporary directory
- Parameters:
site_type,style_hints,site_name, optionaluser_request, optionaluser_content - When
user_requestis provided, the site is customized: multiple pages, images (via placeholders), and AI-generated or user-provided text - Outputs: Static site files (e.g. index.html, about.html, styles.css, nginx.conf)
2. containerize_site: Creates a Docker image for the site
- Parameters:
site_path,image_name - Outputs: Dockerfile and built Docker image
3. deploy_to_spaces: Uploads the static site files to a DigitalOcean Space (S3-compatible). Creates the bucket via the API if it doesn't exist, then uploads the files.
- Parameters:
site_path,bucket_name,region(e.g. nyc3), optionalspaces_access_key/spaces_secret_key(or use env),…
Excerpt shown — open the source for the full document.
Notability
notability 2.0/10Low traction, routine new repo