Publish and update a site
Put your project on the web, publish later edits, or take the site offline.
Publish for the first time
- Test the project in Preview.
- When the current task finishes, choose + beside the workspace tabs and open Publish.
- Choose Publish site. Sign in if prompted.
- Follow the conversation while freecode prepares the release. When the live link appears in the Publish tab, open it and try the page before sharing the address.
What can run on a published site?
Static sites can serve HTML, CSS, JavaScript, and images. Where Worker publishing is available, compatible apps can also run server routes and use configured storage. If your app requires Linux to run, ask the agent what needs to change for it to publish as a Worker.
If your project is a script, tell the agent what visitors should see. For example, ask it to publish a page that shows the chart the script produced.
Set up Worker secrets
If Publish opens a secure form, save the requested values there, then select Publish site or Update site again. The form defaults to Development and published site when sharing is available. You can also open + → Secrets in the workspace to manage values directly. Development and shared values are available to Preview and to Development tests you run. Save a Publish or shared value for the live site. Workers receive these values as bindings. Secret values stay out of project files and ordinary Linux shell sessions.
If you maintain the Worker, declare the required binding names in wrangler.jsonc. For example:
{
"main": "src/worker.ts",
"env": {
"development": { "secrets": { "required": ["API_KEY", "TEST_TOKEN"] } },
"production": { "secrets": { "required": ["API_KEY", "LIVE_TOKEN"] } }
}
}Freecode uses development for Preview and production for Publish. Repeat shared names in both lists. If a named environment is absent, that target uses the top-level secrets.required list. Keep other Worker settings at the top level and save credential values in Secrets.
When the agent reads Wrangler configuration, Freecode also shows which secret names are saved for each scope. Saving a secret leaves the configuration file as written.
Publish later edits
Visitors keep seeing the version you last published. After changing the project, check the new version in Preview. When you want visitors to see it, open Publish and choose Update site. Open the live link to confirm the update. The address stays the same.
Connect a domain
If Custom domain is available in the Publish tab, enter a hostname you own. Add the displayed DNS records with your DNS provider, then choose Check setup. Your domain works once setup reports Connected. You can keep sharing your original freecode link too.
Take a site offline
In the Publish tab, choose Unpublish. The Project tab shows Private under Visibility again. You can keep editing the project and publish it again later.