2.0 KiB
Deployment setup guide
This guide connects one Gitea repository to one server environment without giving the desktop arbitrary shell access.
1. Add fixed workflows
Copy these examples into the repository:
examples/gitea-actions/deploy.yml -> .gitea/workflows/deploy.yml
examples/gitea-actions/rollback.yml -> .gitea/workflows/rollback.yml
Change the runner label to the label registered for the target environment.
2. Install the allowlisted server entry point
Copy examples/server/forgeflow-deploy to /usr/local/bin/forgeflow-deploy, customize its repository/environment allowlist and make it root-owned:
sudo install -o root -g root -m 0755 forgeflow-deploy /usr/local/bin/forgeflow-deploy
Grant the runner account permission to execute only this entry point where elevation is needed. Do not grant unrestricted shell or Docker administration merely for ForgeFlow.
3. Expose deployment status
The example script writes an atomic JSON document beneath /var/lib/forgeflow-status. Serve the appropriate file at a fixed HTTPS URL, for example with examples/server/nginx-forgeflow-status.conf.
See STATUS_ENDPOINT.md for the contract.
4. Configure the ForgeFlow profile
Open the repository, choose Deployments and add an environment with:
- Name:
ProductionorStaging. - Environment: the fixed workflow input.
- Branch: usually
main. - Workflow file:
deploy.yml. - Rollback workflow:
rollback.yml. - Status URL: the JSON endpoint.
- Healthcheck URL: the application health endpoint.
- Confirmation: enabled for production.
5. Validate the complete path
Test these scenarios before relying on production:
- Clean commit and push.
- Successful deployment to the exact SHA.
- Gitea runner failure.
- Application healthcheck failure.
- Server reports the wrong SHA.
- Second deployment while the lock is held.
- Rollback to the recorded previous SHA.
- Token without sufficient permissions.
Keep a manual recovery path documented even after rollback works.