Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to deploy to .workers.dev? #7

Closed
rschristian opened this issue May 7, 2021 · 8 comments · Fixed by #9
Closed

Ability to deploy to .workers.dev? #7

rschristian opened this issue May 7, 2021 · 8 comments · Fixed by #9

Comments

@rschristian
Copy link

First off, apologies if this is a misunderstanding, first time playing with workers so I still have a lot of doc reading to do.

It seems that cfw can only deploy to custom domains, hence the requirement on having a zoneid. Is this intentional, or maybe a limitation on CF's side? As I don't have any domains set up with CF at the moment, there's no way to get a zoneid for quick demo of worktop + cfw. Had to switch over to wrangler for that.

Certainly not a huge deal as anything past a demo I'd want to toss up on a real domain anyhow.

@lukeed
Copy link
Owner

lukeed commented May 7, 2021

Hey,

Ya I plan on adding this. In the meantime you can put in a junk zoneid and leave your routes empty. This allows the script to be uploaded.

Then after your first upload, you go into your dashboard and manually turn on the "deploy to workers subdomain" toggle. This persists across deployments, so all future deploys will keep going to your subdomain.

@rschristian
Copy link
Author

Oh cool! Didn't even think to try a junk id, certainly wouldn't expect that to persist. Good to know!

@lukeed
Copy link
Owner

lukeed commented May 7, 2021

The zoneid is just needed to define the routes :) I do throw an error if the value is empty, but if it's invalid-but-never-used then it's not a problem, haha

I'll add something nicer of course, but I havent decided yet how to deal with multiple environments, and I think that's how/where a subdomain: boolean value should come in.

lukeed added a commit that referenced this issue Aug 14, 2021
@lukeed lukeed closed this as completed in #9 Aug 14, 2021
lukeed added a commit that referenced this issue Aug 14, 2021
@simplenotezy
Copy link

@lukeed How would we go about testing locally on a workers.dev domain?

@lukeed
Copy link
Owner

lukeed commented Aug 4, 2022

See tagged commit and PR; use ‘subdomain: true’ in config file

@simplenotezy
Copy link

Very cool, thanks - missed that

@simplenotezy
Copy link

@lukeed is there a way to run it in "watch" mode? So it hot-reloads on changes?

@lukeed
Copy link
Owner

lukeed commented Nov 21, 2022

Redeploy on every file save? You’d have to use an external file watcher; eg:

watchlist src — cfw deploy

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 a pull request may close this issue.

3 participants