mcpField
E
encore-deploy

encore-deploy

github.com/encoredevCloud & DevOps3058 installsUpdated 2w ago
Repository

About encore-deploy

A skill for deploying existing Encore.ts and Encore.go applications to Encore Cloud through Git pushes. It helps developers verify deployment branches, environments, tests, and secrets before pushing, and troubleshoot whether a deployment started.

Key features

  1. 01Identify the deployment Git remote
  2. 02Check branch-to-environment mappings
  3. 03Run tests and validate secrets before deployment
  4. 04Redeploy with an empty commit or Dashboard
  5. 05Troubleshoot push and deployment issues

Use cases

  1. 01Confirm whether a push will deploy to production
  2. 02Prepare tests and environment secrets before deployment
  3. 03Redeploy after adding a missing secret
  4. 04Diagnose why a Git push did not start deployment

MCP support

The Encore Cloud MCP server can list environments, deployments, builds, and logs to track deployment progress.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/encoredev/skills --skill encore-deploy

After installing, type/encore-deployin Claude Code to confirm it loaded.

Details

From the project README

Deploying to Encore Cloud

Deploying is a commit and a push to the git repository the app deploys from. Encore Cloud builds, tests, provisions infrastructure, and deploys to every environment that deploys from the pushed branch. The same steps work for Encore.ts and Encore.go.

Instructions

Find the repository the app deploys from
git remote -v
  • Encore-managed git (the default): the app deploys from the encore remote. Push there.
  • Linked GitHub repository: if the app is linked to GitHub in the Cloud Dashboard (Settings > GitHub), pushes to that repository deploy instead. Push to it, usually origin.
  • Neither: the app isn't linked to Encore Cloud yet. See Link an app.

If you can't tell which one the app deploys from, ask the user.

Check which environments a push deploys to

Each environment deploys from its own branch (the environment's Settings > Branch Push), or only manually. A new app has one environment, staging (type development), which deploys the app's main branch.

One push can deploy several environments. If a production environment deploys from the branch you're about to push, the push deploys to production, so check the branch before pushing.

Deploy
git add -A
git commit -m "Describe the change"
git push encore              # Encore-managed git
git push origin <branch>     # linked GitHub repository

Pushing to encore: a successful push prints one line per environment that's deploying:

remote: <branch>: triggered deploy https://app.encore.dev/<app-id>/envs/<env>/deploys/<id>

If no such line appears, nothing was deployed:

  • Everything up-to-date: nothing new was committed. Commit, then push again.
  • No triggered deploy line: no environment deploys from the pushed branch.

Pushing to GitHub: git prints nothing from Encore. Check Deployments in the Cloud Dashboard.

Either way, the push returns as soon as the deploy starts. Follow progress in the Cloud Dashboard, or through the Encore Cloud MCP server (https://api.encore.dev/mcp, set up with encore-mcp), which lists environments, deploys, builds, and their logs. Each environment's API is served at https://<env>-<app-id>.encr.app, unless it has a custom domain. encore logs --env=<env> streams its logs.

Deploy again

Every new commit pushed to an environment's branch deploys it again. To redeploy without a code change, for example after setting a missing secret, push an empty commit:

git commit --allow-empty -m "Redeploy"
git push encore              # Encore-managed git
git push origin <branch>     # linked GitHub repository

You can also redeploy from the Cloud Dashboard: Deployments > New Deploy > Branch.

Before pushing
  • Tests: the deploy runs the app's tests, and failing tests block it. Run them first. For Encore.ts, use CI=true encore test: a vitest script runs in watch mode without a terminal and never exits. For Encore.go, use encore test ./....

  • Secrets: every secret the app declares needs a value in each environment it deploys to, or the deploy fails with secret key(s) not defined. Set values per environment type, or for a single environment:

    printf '%s' "$VALUE" | encore secret set --type dev,local MySecret   # development environments, such as staging
    printf '%s' "$VALUE" | encore secret set --type prod MySecret        # production environments
    printf '%s' "$VALUE" | encore secret set --env <env> MySecret        # one environment
    
Link an app

If encore.app has an empty "id", or there's no encore remote and the app doesn't deploy from GitHub, the app isn't linked to Encore Cloud. Link it first (see encore-link-app), then come back here. For an app that's on Encore Cloud but not on this machine, clone it with encore app clone <app-id>, or git clone its GitHub repository if it's linked to GitHub.

When a push to encore fails
  • could not get Encore auth token: not logged in: log in (see encore-login).
  • 'encore' does not appear to be a git repository: the remote is missing. See Link an app.
  • The push hangs: git push encore uses SSH to git.encore.dev on port 22, which some networks block.

Guidelines

Comments

Markdown supported