Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Deployment

Introduction

Deploying a Sukarix application involves several steps to ensure your code is properly set up on the production server.

Sukarix Deployment Basics

  1. Upload Your Code:

    • Transfer your application’s codebase to the production server using your preferred method (e.g., FTP, SCP, or Git).
  2. Ensure sukarix.sh is in the tools Directory:

    • Make sure the sukarix.sh script is located in the tools directory of your application.
  3. Run the Deployment Script:

    • Execute the deployment script with the -d option:
      ./tools/sukarix.sh -d
      
    • This command performs the following actions:
      • Pulls the latest code from the Git repository.
      • Runs Composer to install dependencies.
      • Applies default permissions to the www-data user.
      • Runs database migrations.
      • Clears the application cache.

Deploying Documentation

The Sukarix documentation is built with mdBook and deployed automatically to GitHub Pages via GitHub Actions — at no cost.

How It Works

  1. A GitHub Actions workflow (.github/workflows/deploy-docs.yml) triggers on every push to the main branch.
  2. It installs the Rust toolchain, then builds mdBook along with the mdbook-toc preprocessor.
  3. mdbook build generates the static site in the book/ output directory.
  4. The output is published to GitHub Pages, served at docs.sukarix.com.

Prerequisites

  • The docs repository must be public (GitHub Pages is free for public repos).
  • The custom domain docs.sukarix.com is set via the cname field in book.toml and configured in GitHub Pages settings.
  • GitHub Pages must be enabled in the repository settings (see steps below).

One-Time Setup

  1. Enable GitHub Pages:

    • Go to the repository on GitHub → SettingsPages.
    • Under Source, select GitHub Actions.
    • Save.
  2. Configure DNS:

    • In your domain registrar, add a CNAME record:
      CNAME  docs  <your-github-org-or-username>.github.io.
      
    • Wait for DNS propagation (can take up to a few minutes to a few hours).
    • GitHub will automatically provision an HTTPS certificate once DNS is verified.

Manual Deployment

To trigger a deployment outside of a push, go to the Actions tab in the repository, select the Deploy Docs to GitHub Pages workflow, and click Run workflow.