Deployment
Introduction
Deploying a Sukarix application involves several steps to ensure your code is properly set up on the production server.
Sukarix Deployment Basics
-
Upload Your Code:
- Transfer your application’s codebase to the production server using your preferred method (e.g., FTP, SCP, or Git).
-
Ensure
sukarix.shis in thetoolsDirectory:- Make sure the
sukarix.shscript is located in thetoolsdirectory of your application.
- Make sure the
-
Run the Deployment Script:
- Execute the deployment script with the
-doption:./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-datauser. - Runs database migrations.
- Clears the application cache.
- Execute the deployment script with the
Deploying Documentation
The Sukarix documentation is built with mdBook and deployed automatically to GitHub Pages via GitHub Actions — at no cost.
How It Works
- A GitHub Actions workflow (
.github/workflows/deploy-docs.yml) triggers on every push to themainbranch. - It installs the Rust toolchain, then builds mdBook along with the
mdbook-tocpreprocessor. mdbook buildgenerates the static site in thebook/output directory.- 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.comis set via thecnamefield inbook.tomland configured in GitHub Pages settings. - GitHub Pages must be enabled in the repository settings (see steps below).
One-Time Setup
-
Enable GitHub Pages:
- Go to the repository on GitHub → Settings → Pages.
- Under Source, select GitHub Actions.
- Save.
-
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.
- In your domain registrar, add a CNAME record:
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.