Skip to content
AtMyAppDocs
Open dashboard
Ship

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 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.

  1. 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.

  2. Set the build command (for example npm run build) and the output directory (dist for Astro).

  3. Start the first build. You can follow its log live.

  4. Add your domain and follow the DNS instructions shown there. Subdomains such as www.example.com point 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.

Netlify, Vercel, Cloudflare Pages, GitHub Pages and similar hosts work like any static build.

  1. Add ATMYAPP_API_URL and ATMYAPP_API_KEY to the host’s build environment. Use the values from Settings → API keys.

  2. Make sure the build fails on a failed read. In Astro this is the default. With @atmyapp/core, set errorPolicy: "throw".

  3. 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 content
    on:
    schedule:
    - cron: "*/30 * * * *" # every 30 minutes
    workflow_dispatch:
    jobs:
    rebuild:
    runs-on: ubuntu-latest
    steps:
    - 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.

With an Astro adapter, Next.js, SvelteKit or any Node server, content is read per request.

  • Configure ATMYAPP_API_URL and ATMYAPP_API_KEY as runtime variables. Astro reads them through astro:env at 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.

A schema change and the code that uses it should go live together:

  1. Run npx atmyapp migrate and review the plan. See Change a live schema.
  2. Deploy the code that reads the new fields.
  3. When removing a field, deploy code that no longer reads it first, then remove it from the schema.
  • 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.json and .env are not in the repository.

Then walk through Hand over to your client.