Skip to content

Conversation

@ammario
Copy link
Member

@ammario ammario commented Oct 6, 2025

Fixes cmux.io 404 error by ensuring CNAME file is included in deployment.

Problem

  • cmux.io returns 404
  • GitHub Pages custom domain requires a CNAME file in the root of deployed files
  • mdbook builds to docs/book/ directory, which becomes the root when deployed
  • The CNAME file was not being included in the build output

Why This Fixes It

GitHub Pages uses the CNAME file to configure custom domain routing:

  1. When GitHub Pages deploys, it looks for a CNAME file in the root of the deployed site
  2. If present, it configures the custom domain to serve that content
  3. Without it, the custom domain (cmux.io) has no content to serve → 404

Our workflow:

  • Builds docs with mdbook → outputs to docs/book/
  • Uploads docs/book/ as artifact → this becomes the root of the deployed site
  • Problem: CNAME file was in docs/ but not copied to docs/book/
  • Solution: Copy CNAME to build output so it's included in deployment

Changes

  • Create docs/CNAME with 'cmux.io'
  • Add workflow step: cp docs/CNAME docs/book/CNAME after build
  • Ensures CNAME is in the deployed artifact root

Testing

Once merged and deployed, https://cmux.io should resolve correctly.

Generated with cmux

- Add CNAME file with 'cmux.io'
- Copy CNAME to build output (docs/book/) in workflow
- Required for GitHub Pages custom domain to work

_Generated with `cmux`_
@ammario ammario force-pushed the fix-cname-deployment branch from 0908ce6 to f3b110c Compare October 6, 2025 17:28
@ammario ammario enabled auto-merge (squash) October 6, 2025 17:30
@ammario ammario merged commit 0df8ed1 into main Oct 6, 2025
6 checks passed
@ammario ammario deleted the fix-cname-deployment branch October 6, 2025 17:30
ammario added a commit that referenced this pull request Oct 6, 2025
## Problem

cmux.io still returns 404 even after PR #49 which added CNAME file.

## Root Cause Investigation

Need to verify:
- CNAME file is being copied correctly to build output
- GitHub Pages is configured to use custom domain
- Deployment is actually happening

## Changes

1. **Add verification logging** - Show CNAME file content and verify it
exists in build output
2. **Update wait_pr_checks.sh** - Exit successfully when PR is
auto-merged (prevents hanging)

## Next Steps

Once this PR runs, we can see in the logs whether CNAME is correctly
placed in the artifact. If it is, the issue may be:
- GitHub Pages custom domain settings need to be configured in repo
settings
- DNS propagation delay
- Need to manually trigger GitHub Pages deployment

## Testing

Check the workflow logs after this runs to verify CNAME is in
`docs/book/CNAME`.

_Generated with `cmux`_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant