Skip to main content

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.

  1. Go to your Hostim Dashboard.
  2. Navigate to Account Settings -> API Tokens.
  3. Create a new token.
  4. Copy the token value.

⚠️ Treat your API token like a password. Do not share it or commit it to your repository.

Setup

  1. In your GitHub repository, go to Settings -> Secrets and variables -> Actions.
  2. Click New repository secret.
  3. Name the secret HOSTIM_API_TOKEN.
  4. Paste your API token as the value.
  5. Click Add secret.

Usage

Use the hostimdev/action in your workflow YAML file.

Inputs (all required)

InputDescription
tokenYour Hostim API Token
projectThe ID of your project
appThe name of your app
commandThe 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 restart command to pull the new image and restart your app.
  • Manual deploy: Use workflow_dispatch to 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.