GitHub Actions Integration
Hostim integrates with GitHub Actions to enable automated deployments without vendor lock-in or hidden logic.
You can trigger app rebuilds or restarts directly from your workflows using the official Hostim GitHub Action.
Overview
The integration allows you to:
- Rebuild an app (for Git-based deployments)
- Restart an app (when a Docker image is already built)
All logic lives in your workflow: triggers, branches, environments, and conditions are fully controlled in GitHub. Hostim only executes the requested action.
Prerequisites
To use the GitHub Action, you need an API Token.
- Go to your Hostim Dashboard.
- Navigate to Account Settings -> API Tokens.
- Create a new token.
- Copy the token value.
⚠️ Treat your API token like a password. Do not share it or commit it to your repository.
Setup
- In your GitHub repository, go to Settings -> Secrets and variables -> Actions.
- Click New repository secret.
- Name the secret
HOSTIM_API_TOKEN. - Paste your API token as the value.
- Click Add secret.
Usage
Use the hostimdev/action in your workflow YAML file.
Inputs (all required)
| Input | Description |
|---|---|
token | Your Hostim API Token |
project | The ID of your project |
app | The name of your app |
command | The command to execute: rebuild or restart |
Example Workflow
Here is a complete example of a workflow that rebuilds an app when changes are pushed to the main branch.
name: Deploy to Hostim
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Trigger Hostim Rebuild
uses: hostimdev/action@v1
with:
token: ${{ secrets.HOSTIM_API_TOKEN }}
project: hpr-123456
app: my-app
command: rebuild
Use Cases
- Rebuild on merge: Automatically deploy changes when code is merged to your main branch.
- Restart after Docker push: If you build your Docker image in a separate job, use the
restartcommand to pull the new image and restart your app. - Manual deploy: Use
workflow_dispatchto create a manual deployment button for production.
Security
- No OAuth required: You don't need to grant Hostim access to your GitHub account.
- Scoped access: API tokens are the only credential needed.
- Audit trail: Actions are logged in your GitHub workflow runs.