Skip to content

Conversation

ppiegaze
Copy link
Collaborator

No description provided.

- Remove duplicate wrangler.jsonc generation in build.yml
- Add assets configuration to wrangler.jsonc for static site hosting
- Add Worker script (src/index.js) to serve static assets
- Update wrangler.jsonc with proper Workers configuration
- Fix both build.yml and preview.yml workflows
- Use ASSETS binding for static site hosting
Copy link

cloudflare-workers-and-pages bot commented Aug 28, 2025

Deploying docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: e6211c0
Status: ✅  Deploy successful!
Preview URL: https://c7faf614.docs-dog.pages.dev
Branch Preview URL: https://peeter-migrate-build-to-gh-a.docs-dog.pages.dev

View logs

- Rename wrangler.jsonc to wrangler.json for better compatibility
- Add explicit entry point in deploy command
- Add comprehensive debugging to troubleshoot deployment issues
- Update preview workflow to use wrangler.json
- Add explicit entry point (src/index.js) to preview deploy command
- Add debugging to preview workflow to show file contents
- This should resolve the missing entry-point error
- Add explicit CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID env vars
- Wrangler requires environment variables in non-interactive mode
- This should resolve the authentication error during deployment
- Change 'deploy src/index.js' to 'deploy' in both workflows
- This allows wrangler to read configuration from wrangler.json
- Fixes the 'need to provide a name' error in CI deployment

The wrangler.json already specifies the entry point via 'main' field,
so specifying it again in the command was causing it to ignore the config.
- Add --config wrangler.json to deploy command
- Ensures wrangler reads the configuration file even in CI environment
- Should resolve the 'need to provide a name' error
- Remove .github/workflows/build.yml
- Remove .github/workflows/preview.yml
- Remove wrangler.json

Starting fresh to rebuild the deployment setup from scratch.
- Triggers on any push to branches except main and v1
- Automatically creates worker name from branch name
- Uses existing make dist build process
- Deploys to CF Workers with sanitized branch-based naming
- Single job workflow for simplicity

Example: branch 'feature/docs' deploys to 'feature-docs.workers.dev'
- Change deploy command to explicitly specify src/index.js entry point
- Add --name flag with sanitized worker name
- Add debug step to show created files before deployment
- Should resolve 'Missing entry-point' error
- Add --compatibility-date 2025-08-28 to wrangler deploy command
- Add --assets dist to include static files
- Resolves 'compatibility_date is required' error
- Now bypasses wrangler.json completely with all params in CLI
- Use single 'on: push' trigger for all branches
- Job conditions handle branch filtering logic
- Much cleaner than having both branches and branches-ignore
- Sanitize branch names for Cloudflare Workers preview aliases
- Remove invalid characters (slashes) from alias names
- Branch 'peeter/migrate-build-to-gh-actions' becomes 'pr-branch-peeter-migrate-build-to-gh-actions'
- Pre-compute branch slug in separate step with output
- Use step outputs instead of inline shell command substitution
- Fixes wrangler command parsing issue with shell expansion
- PR branches now deploy complete site with /docs/v2/* structure
- Remove PR-scoped paths like /docs/pr-<branch>/
- PR preview URLs: https://pr-branch-\<slug\>-unionai-docs.subdomain.workers.dev/docs/v2/
- Matches production URL structure for easier testing
- Shorten preview alias to avoid length limits (pr-<slug> vs pr-branch-<slug>)
- Add debugging info: branch slug, file counts, directory structure
- Limit branch slug to 20 chars to avoid Cloudflare limits
- Better error visibility in deployment logs
- Add '|| true' to find | head commands to prevent broken pipe errors
- This was causing workflow failures when head terminated early
- Replace preview aliases with individual worker deployments
- Each PR branch gets its own worker with unique name
- Add debugging output for wrangler.jsonc content
- This should resolve the 404 issues with preview URLs
@ppiegaze ppiegaze marked this pull request as draft September 17, 2025 16:02
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