GitHub Actions (CI/CD)
LaraKube automates your entire deployment pipeline using GitHub Actions. Every project comes pre-scaffolded with a production-grade workflow.
⚡️ The Automated Pipeline
When you push code to your main branch, the following steps occur:
- Frontend Build: A temporary Node.js stage installs dependencies and compiles your assets using Vite.
- Multi-Stage PHP Build: The compiled assets are copied into a fresh PHP image. This ensures your production image is "self-contained" and contains no unnecessary Node.js overhead.
- GHCR Publication: The image is pushed to the GitHub Container Registry (GHCR).
- Cluster Deployment: The latest version is rolled out to your Kubernetes cluster with zero downtime.
🔐 Configuring Secrets
To enable the automated pipeline, you must securely upload your configuration to GitHub. Run the following command for your target environment:
larakube gha:configure production
What this command does:
- Uses an isolated GitHub CLI container (no local installation needed).
- Uploads your
.env.productionas a GitHub Secret. - Uploads your current
KUBECONFIGas a GitHub Secret. - Sets up the registry authentication for your cluster.
Manual Deployments
If you need to push a quick update without a Git push, you can deploy manually from your terminal:
larakube deploy production