Skip to content

Instantly share code, notes, and snippets.

@benjiwheeler
Created October 15, 2025 16:48
Show Gist options
  • Select an option

  • Save benjiwheeler/058531d51e4872cba78d0ee47330b621 to your computer and use it in GitHub Desktop.

Select an option

Save benjiwheeler/058531d51e4872cba78d0ee47330b621 to your computer and use it in GitHub Desktop.
How to deploy a local Claude Code web project to Github
  1. open a terminal (on Mac, you can use the "Terminal" application). In these instructions, when it says "run some command", that means to type or copy/paste that command into a prompt in your terminal.
  2. have a directory with code in it, with an index.html file that does what you want when you view it in a browser. Navigate into that directory in the terminal, using the cd command, like: cd ~/somefolder/someotherfolder/whereyourcodeis/
  3. have the git program installed (you can check if it is installed by running which git; if it does nothing, git is not installed. If it shows you a directory path that ends in "git", it is installed.)
  4. in a separate terminal window, navigate to your same code directory, and run Claude Code using claude
  5. go to github.com; create an account if you don't have one.
  6. create a GitHub project; call it whatever you want (I suggest not using spaces)
  7. once it's created, you'll see a page that says "Quick setup". Under it should be a section called "…or create a new repository on the command line".
  8. one line at a time, copy the code that is under "…or create a new repository on the command line", and paste it into your terminal.
  9. in Claude Code, enter this prompt:
Please help me reconfigure this directory and its files so that I can deploy it to GitHub's gh-pages feature. 

Target structure:
- Make a src/ directory; move source files into src/ directory
- Set up a dist/ directory for the bundled output
- Create package.json with these scripts:
  - "build": use webpack to bundle src files into dist/
  - "predeploy": "npm run build"
  - "deploy": "gh-pages -d dist"
- Create webpack.config.js to:
  - Bundle JavaScript into dist/bundle.js
  - Copy index.html to dist/ (with HtmlWebpackPlugin)
  - Handle any CSS appropriately
- Create a .gitignore file that excludes node_modules and dist

After creating these files: 
- please run npm install to install all dependencies
- hen run npm run build to verify the build works correctly

The final workflow should be: 
`npm run deploy` (which will build and deploy to gh-pages)
  1. now, in your terminal prompt, enter: npm run deploy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment