sevalla-hosting/sevalla-deploy, starts a deployment of an application or static site, or a promotion in a pipeline, from a GitHub Actions workflow, and can wait until it finishes. Use it when a deployment should happen only after your workflow’s tests or image build pass. If every push to a branch should deploy, automatic deployments need no workflow at all.
The current version is v2.0.0, which uses the Sevalla API v3. Versions v1.0.0 and v1.0.1 call an older API version and don’t take pipeline-id; move to v2.0.0.
Before you begin
-
An API key for the workflow, with custom capabilities limited to the service it deploys:
-
The key stored as a repository secret: in GitHub, open the repository’s Settings > Secrets and variables > Actions, and add it as
SEVALLA_TOKEN. - The service’s ID: in the Sevalla dashboard, open the application or static site, click the Settings tab, and copy ID under Details.
- If the action deploys the same branch Sevalla already deploys on every push, turn off automatic deployments for it, or each push deploys twice.
Deploy an application after tests pass
.github/workflows/deploy.yml
deploy job starts once test passes. In the job’s log, the action prints Deployment (id: ...) triggered successfully!, then Deployment status: ... every 5 seconds. The job succeeds when the deployment’s status is success, and the deployment appears on the application’s Deployments tab.
Inputs
Outputs
Give the step an
id to read an output in a later step, for example ${{ steps.deploy.outputs.deployment-id }}.
Wait for the result
Withwait-for-finish: true, the action checks the deployment every 5 seconds until its status is success, failed, cancelled or skipped, and fails the step with Deployment failed: status is ... for anything but success. It stops after 1,000 checks (about 83 minutes) with Max retries reached while polling deployment status. A check that can’t read the status is logged and retried. Without wait-for-finish, the step succeeds as soon as Sevalla accepts the deployment.
Deploy a Docker image
Build and push an image in the same workflow, then deploy that exact tag:.github/workflows/deploy.yml
Deploy a static site
.github/workflows/deploy-site.yml
Promote in a pipeline
.github/workflows/promote.yml
/pipeline/<id>), and sevalla pipelines list shows it too. With wait-for-finish, the action waits for every target application’s deployment.
Deploy with a deploy hook
A deploy hook is a secret URL that deploys an application when it receives aPOST, with no API key: the latest commit of its default branch, or its current Docker image. Store the URL as a secret, such as SEVALLA_DEPLOY_HOOK_URL, and either pass it to the action:
{"message":"App is being deployed","deployment":{"id":"..."}}. To wait for the result with the action, also set sevalla-token, app-id and wait-for-finish: true; without app-id, the action skips waiting with a warning. A deploy hook can’t pick a branch or an image: use the API key inputs for that.
Use the Sevalla CLI in a workflow
For steps the action doesn’t cover, install the Sevalla CLI and give it the key inSEVALLA_API_TOKEN:
.github/workflows/deploy.yml
sevalla apps deployments get as shown in Use JSON output in scripts.