Deploy
Ship on AtMyApp hosting with automatic rebuilds, or on any other static or server host.
Open with AI
How your website is deployed decides when your client’s published edits go live. Pick the setup that matches how you render.
| Setup | Published edits go live | You configure |
|---|---|---|
| AtMyApp hosting (static) | Automatically, after a rebuild | Your code (stored in AtMyApp or on GitHub) and a build command |
| Another static host | When you rebuild | Environment variables and a rebuild trigger |
| A server | On the next request | Environment variables and caching |
AtMyApp hosting
Section titled “AtMyApp hosting”AtMyApp builds your code and serves the result. The code can be stored in AtMyApp with the project, which is the default for new projects, or in a connected GitHub repository. When your client publishes, a new build starts, and the site switches over only when the build succeeds.
-
Give AtMyApp the code: in the project’s Setup, keep Store the code in AtMyApp and push to it (
npx atmyapp code setup-git && git push atmyapp main), or choose Connect GitHub. -
Set the build command (for example
npm run build) and the output directory (distfor Astro). -
Start the first build. You can follow its log live.
-
Add your domain and follow the DNS instructions shown there. Subdomains such as
www.example.compoint at AtMyApp with a CNAME record.
Builds receive these environment variables automatically, so you don’t add your keys:
| Variable | Value |
|---|---|
ATMYAPP_API_URL |
The Project API URL |
ATMYAPP_API_KEY |
A project API key |
ATMYAPP_CODE_COMMIT, ATMYAPP_BUILD_TIME |
Used by diagnostics |
Add any other variables your build needs in the hosting settings. Rebuild on publish is on by default for new websites; you can turn it off there too. Pushing to the website’s branch also starts a build, whether the code is stored in AtMyApp or on GitHub.
A failed build never replaces the live site. If content breaks a build, for example because a required read fails, the previous version stays online and the build log shows why.
Another static host
Section titled “Another static host”Netlify, Vercel, Cloudflare Pages, GitHub Pages and similar hosts work like any static build.
-
Add
ATMYAPP_API_URLandATMYAPP_API_KEYto the host’s build environment. Use the values from Settings → API keys. -
Make sure the build fails on a failed read. In Astro this is the default. With
@atmyapp/core, seterrorPolicy: "throw". -
Decide how rebuilds happen after your client publishes.
AtMyApp doesn’t trigger builds on other hosts, so choose one:
-
Rebuild on a schedule. Most hosts offer a deploy hook URL. Call it periodically:
.github/workflows/rebuild.yml name: Rebuild with fresh contenton:schedule:- cron: "*/30 * * * *" # every 30 minutesworkflow_dispatch:jobs:rebuild:runs-on: ubuntu-lateststeps:- run: curl -fsS -X POST "$DEPLOY_HOOK_URL"env:DEPLOY_HOOK_URL: ${{ secrets.DEPLOY_HOOK_URL }} -
Rebuild by hand. Fine for sites that change rarely. Tell your client who to ask.
-
Render on the server instead, so there’s nothing to rebuild.
Previews need a server. Static hosts can’t show drafts, so keep previews on AtMyApp preview servers.
Server rendering
Section titled “Server rendering”With an Astro adapter, Next.js, SvelteKit or any Node server, content is read per request.
- Configure
ATMYAPP_API_URLandATMYAPP_API_KEYas runtime variables. Astro reads them throughastro:envat runtime. - Published reads may be cached for up to 60 seconds. Add your own page caching on top if you need it.
- Create a client per request when you support previews, and never cache preview responses. See Drafts and previews.
For Astro, build with DEV_MODE=true and an adapter. See Dynamic production.
Release schema and code together
Section titled “Release schema and code together”A schema change and the code that uses it should go live together:
- Run
npx atmyapp migrateand review the plan. See Change a live schema. - Deploy the code that reads the new fields.
- When removing a field, deploy code that no longer reads it first, then remove it from the schema.
Production checklist
Section titled “Production checklist”-
site(Astro) or your canonical URL setting points at the production domain. - A published page renders the expected content without
?amaPreviewKey. - Page titles, descriptions, social image and favicon are right. Check with a link preview tool.
- A small published edit reaches the live site (after a rebuild, for static sites).
- A preview shows a draft, and the live site doesn’t.
- A real form submission arrives in the inbox. Use test mode to avoid clutter.
- The form’s Allowed websites list includes the production domain. See Spam protection.
-
.ama/session.jsonand.envare not in the repository.
Then walk through Hand over to your client.
