app-deployment
Scannednpx machina-cli add skill The-Focus-AI/marina-skill/app-deployment --openclawApp Deployment Skill
You help deploy applications using a git-push-to-deploy workflow.
Setup
- Run
bash ${CLAUDE_PLUGIN_ROOT}/scripts/check-deps.shto verify tools are available.
How Deployment Works
- User runs
git push production main - SSH connects to server as
deployuser - SSH forced-command routes to
deployerscript deployercreates a bare git repo (first time), receives the pushpost-receivehook checks out code and runsdocker builddeployerstops old container and starts new one with Caddy labels- Caddy automatically provisions HTTPS and reverse proxies to port 8080
App requirements:
- Must have a
Dockerfilein the project root - Container must listen on port 8080
Scripts
Deployment utilities use ${CLAUDE_PLUGIN_ROOT}/scripts/deploy.sh:
Copy env to server
bash ${CLAUDE_PLUGIN_ROOT}/scripts/deploy.sh env
Copies .env.production (preferred) or .env to the server and restarts the container.
Restart container
bash ${CLAUDE_PLUGIN_ROOT}/scripts/deploy.sh restart
Force rebuild
bash ${CLAUDE_PLUGIN_ROOT}/scripts/deploy.sh push-empty
Creates an empty commit and pushes to trigger a full rebuild.
Show remote info
bash ${CLAUDE_PLUGIN_ROOT}/scripts/deploy.sh info
Setting Up a New Deployment
Walk the user through these steps:
-
Check prerequisites:
- Verify
Dockerfileexists - Check the app listens on port 8080
- Verify
-
Check for existing remote:
git remote -v | grep production -
If no production remote, guide setup: a. List servers:
bash ${CLAUDE_PLUGIN_ROOT}/scripts/server.sh listb. Discover domains:bash ${CLAUDE_PLUGIN_ROOT}/scripts/dns.sh list-zonesc. Pick/create server and choose app name d. Add remote:git remote add production deploy@<server>.<domain>:<appname>.<domain>e. Add DNS:bash ${CLAUDE_PLUGIN_ROOT}/scripts/dns.sh add <appname>.<domain> <server_ip>f. Push:git push production main -
After deployment: the app is at
https://<appname>.<domain>(Caddy handles HTTPS).
Git Remote Format
deploy@<server-hostname>:<site-fqdn>
Example: deploy@web1.example.com:myapp.example.com
The site FQDN becomes both the Docker container name and the hostname Caddy uses for routing/HTTPS.
Behavior
- Check for
Dockerfilebefore attempting deployment - When setting up, show the full git remote URL and confirm
- After deployment, tell the user the app URL
- If deployment fails, suggest checking logs:
ssh deploy@<server>(shows last 20 log entries) - Warn about sensitive values before copying env files
Source
git clone https://github.com/The-Focus-AI/marina-skill/blob/main/skills/app-deployment/SKILL.mdView on GitHub Overview
Deploy apps using a git-push-to-deploy workflow. It sets up a production remote, pushes code, manages environment variables, and restarts containers, with Caddy provisioning HTTPS and routing to port 8080.
How This Skill Works
On push to production main, an SSH login as deploy triggers a deployer script via a forced command. The script creates a bare git repo if needed, receives the push, and the post-receive hook checks out code and runs docker build, then the deployer stops the old container and starts a new one labeled for Caddy. Caddy then provisions HTTPS and reverse proxies to port 8080.
When to Use It
- Deploy a new app to a remote server using a production remote
- Update an existing app by pushing code to production main
- Copy environment variables to the server before restarting the container
- Force a full rebuild after env or dependency changes
- Verify the app URL and HTTPS via Caddy after deployment
Quick Start
- Step 1: Check prerequisites: verify Dockerfile exists and the app listens on port 8080
- Step 2: Check for a production remote; if absent, run server and DNS discovery commands and add the remote, then push to production main
- Step 3: After deployment, verify the app at https://<appname>.<domain> and use deploy.sh info to view remote details
Best Practices
- Ensure a Dockerfile exists in the project root
- Confirm the app listens on port 8080
- Check for an existing production remote before pushing
- Copy env files with caution and restart the container after deploy
- Use the deploy.sh scripts (env, restart, push-empty, info) for common tasks
Example Use Cases
- Deploying a new app to a server via git push production main
- Updating an existing app by pushing new code to production main and watching deployments
- Copying .env.production to the server and restarting the container
- Forcing a rebuild with push-empty to trigger a full docker build
- Checking remote info after setting up a new deployment