Skip to main content

Overview

Deploy your LiveCodes projects as standalone websites hosted on GitHub Pages for free. Your project becomes a public website accessible at:
https://username.github.io/repo-name/

Quick Deploy

1

Sign in with GitHub

Click MenuSign in and authorize LiveCodes
2

Open Deploy

Click MenuDeployDeploy to GitHub Pages
3

Configure

  • Enter repository name
  • Choose to include source files (optional)
  • Decide between single HTML file or separate files
4

Deploy

Click Deploy and wait for the process to complete
5

Visit Site

Your site is live at https://username.github.io/repo-name/
Deployment creates a new repository with a gh-pages branch. GitHub Actions automatically publishes your site.

Deploy Options

Repository Settings

Creates a new public repository:
Repository name: my-awesome-project
Branch: gh-pages
Visibility: Public
Deploying to an existing repository will overwrite all files in the gh-pages branch.

File Structure Options

Single HTML File:
repo/
└── index.html  (all code embedded)
Separate Files:
repo/
├── index.html
├── style.css
└── script.js
Include Source Files:
repo/
├── index.html
├── style.css
├── script.js
└── src/
    ├── index.html
    ├── style.scss
    ├── script.ts
    └── livecodes.json
Include source files if you want others to:
  • View your original code
  • Import your project back into LiveCodes
  • Contribute to your project

What Gets Deployed

Compiled Output

  • HTML: Compiled markup (e.g., Pug → HTML)
  • CSS: Compiled styles (e.g., SCSS → CSS)
  • JavaScript: Compiled scripts (e.g., TypeScript → JavaScript)
  • External resources: Linked stylesheets and scripts

Source Files (Optional)

  • Original markup, style, and script files
  • livecodes.json configuration
  • README with project info and LiveCodes link

Generated Files

  • README.md: Auto-generated with project description
  • .gitignore: Standard web project ignore file
  • LICENSE: Optional license file

Deployment Process

1

Compile Code

LiveCodes compiles all your code to vanilla HTML/CSS/JS
2

Create Repository

A new public repository is created on GitHub (if new)
3

Commit Files

All files are committed to the gh-pages branch
4

Enable GitHub Pages

GitHub Pages is automatically enabled for the gh-pages branch
5

Build & Deploy

GitHub Actions builds and publishes your site (takes 1-2 minutes)

Repository Structure

Created repository includes:
# My Awesome Project

Deployed from [LiveCodes](https://livecodes.io)

## Description

Your project description here.

## Links

- [Live Demo](https://username.github.io/repo-name/)
- [Source Code](https://github.com/username/repo-name/tree/gh-pages/src)
- [Edit in LiveCodes](https://livecodes.io/?x=project-id)

## Technologies

- HTML
- CSS
- JavaScript

Custom Domains

Add a custom domain to your deployed site:
1

Configure DNS

Point your domain to GitHub Pages:
CNAME: username.github.io
2

Add CNAME File

In your repository, create CNAME file:
www.yourdomain.com
3

Enable HTTPS

GitHub automatically provides SSL certificates

Redeployment

Update your deployed site:
1

Make Changes

Update your code in LiveCodes
2

Deploy Again

Use the same repository name when deploying
3

Confirm Overwrite

Confirm you want to update the existing deployment
Changes typically appear within 1-2 minutes after deployment.

Deploy Single Assets

Deploy individual files (images, data files) to an existing repo:
import { createPlayground } from 'livecodes';

const playground = await createPlayground('#container');

// Deploy a single file
const result = await playground.exec('deployFile', {
  file: {
    path: 'data.json',
    content: JSON.stringify({ foo: 'bar' })
  },
  repo: 'my-assets',
  branch: 'gh-pages',
  message: 'Add data file'
});

console.log(result.url); // File URL

Limitations

  • Repositories are public (GitHub Pages requirement for free accounts)
  • 1 GB repository size limit
  • 100 GB bandwidth per month
  • 10 builds per hour

Troubleshooting

  • Wait 1-2 minutes for GitHub to build and publish
  • Check repository settings → Pages section
  • Verify gh-pages branch exists
  • Check browser console for errors
  • Ensure external resources use absolute URLs
  • Check that CDN links are accessible
  • Verify image paths are correct
  • Test in LiveCodes before deploying
  • Check browser console for errors
  • Verify all dependencies are included

Best Practices

1

Test First

Thoroughly test your project in LiveCodes before deploying
2

Add Description

Set a clear title and description for your project
3

Include Source

Enable “Include source files” for transparency
4

Use Meaningful Names

Choose descriptive repository names
  • Export - Export as files
  • Share - Share project URLs
  • Assets - Manage project assets
  • Import - Import from GitHub and other sources

Build docs developers (and LLMs) love