hi-folks/ghygen
Ghygen generates GitHub Actions workflow YAML for Laravel projects via an intuitive GUI, handling PHP matrix testing, caching, database services, and deployment steps. Skip hand-writing CI config and get a ready-to-use pipeline in minutes.
ghygen is a scaffolding tool, not a runtime dependency: it renders a .github/workflows/*.yml file for you (Laravel CI: PHP matrix, composer caching, php artisan test, npm build, code-quality/security steps) and you commit the YAML. Plan to install it in require-dev, generate once, and possibly remove it afterwards.
Minimal path:
composer require --dev hi-folks/gh-actions-yaml-generator
php artisan ghygen:install # publishes config + routes
php artisan serve
# open http://127.0.0.1:8000/ghygen
Where to look first:
config/ghygen.php — every UI toggle maps to a config key; this is the source of truth for what the YAML will contain./ghygen — a form per concern (general/triggers/branches, PHP versions, Laravel version, composer, node, testing, code quality, security, custom steps) with a live YAML preview and a save/download action. As of v1.0.1 the selects cover PHP 8.3, Laravel 11, and Node 20.First use case: a brand-new Laravel 11 project where you want push/pull_request CI on main with a PHP 8.2/8.3 matrix, composer cache, copy .env, key:generate, php artisan test. In v1.0.1 you can pick Laravel 11 + PHP 8.3 + Node 20 directly from the selects instead of hand-editing afterwards. Copy the YAML into .github/workflows/ci.yml, commit, and let CI prove it out.
Generate-then-own. The strongest pattern is: use ghygen as an interactive template engine, commit the output, then treat the YAML as hand-maintained. Keep config/ghygen.php in the repo (or in a .ghygen/ backup) so you can re-enter the UI later and re-render when you add a service container or bump PHP versions.
Preview-first workflow. Iterate in the UI, use the YAML preview to diff mentally against your committed file, and only then write. If you prefer to keep the package, the config file lets you reproduce the exact same YAML on demand — useful on a new branch of the same project.
Start on the modern defaults. With v1.0.1, the first render can be Laravel 11 + PHP 8.3 + Node 20 + actions/checkout@v4 + actions/cache@v4 out of the box. Use that as the baseline; the manual bumping that older versions required is mostly unnecessary now.
One workflow per concern. Generate the CI workflow, but keep separate workflows for deployment, scheduled jobs, or release tagging. Ghygen's strength is the "run tests + static analysis + build assets" slice; forcing deploy logic through the UI's custom-steps field ages poorly.
Matrix and services tuned in the UI, then edited. Typical generated shape:
strategy:
matrix:
php: ['8.2', '8.3']
services:
mysql:
image: mysql:8
env:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: password
ports: ['3306:3306']
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5
Use the UI to get the boilerplate right (health checks, env wiring, shivammathur/setup-php extensions), then refine by hand — e.g. add --parallel, coverage upload, or composer validate --strict.
Bootstrapping a team standard. If you maintain many Laravel repos, configure ghygen once in your "canonical" project, save the output as an internal starter workflow (.github/workflow-templates/ or a shared gist), and copy it into new repos. Ghygen effectively becomes your CI style guide generator.
Custom steps for the last mile. Put things the UI doesn't model — php artisan migrate --force against the service DB, npm run build, vendor/bin/phpstan analyse with your chosen level — into the custom-commands section as explicit run: lines, rather than fighting the toggles.
/ghygen in production. The install publishes routes into your app. Gate them (APP_ENV === 'local'), delete the route registration after generation, or never install outside a throwaway/local environment. Verify the route is absent in php artisan route:list for deployed environments.actions/checkout@v4, actions/setup-node@v4, actions/cache@v4, github/codeql-action/upload-sarif@v3, symfonycorp/security-checker-action@v5, and webfactory/[email protected], and adds PHP 8.3 / Laravel 11 / Node 20. These are current as of early 2024, but any generator will drift again. After generating, still glance at @vN tags and confirm ubuntu-latest matches your intent (pin ubuntu-22.04 if you depend on specific libs).key:generate, migrate, and env-file steps still match the slimmed-down 11 skeleton — 11 removed some of the bootstrapping that earlier Laravel versions had by default, and a generator tuned for 10-and-earlier may still assume them. Diff the generated YAML against a known-good Laravel 11 workflow the first time.phpstan.neon with a different level, edit the invocation (--level=) or point it at your config; don't assume the defaults match your project.php artisan key:generate fails without .env. Make sure the sequence is cp .env.example .env → key:generate → migrate → test, and that APP_KEY isn't baked into a committed .env file.DB_HOST=127.0.0.1, DB_PORT=3306, and your .env.ci/phpunit.xml must actually be read. Sqlite (DB_CONNECTION=sqlite, touch database/database.sqlite) is simpler for pure unit tests and avoids service-container flakiness.composer.lock in the cache key. Ghygen's composer cache is typically keyed on composer.lock; if the project has no lock file committed, caching is a no-op or worse, stale. Commit the lock.npm install vs npm ci. The generated step may default to install; swap to npm ci for reproducibility and fail-fast behavior.git diff the YAML. Prefer downloading and manually pasting if your workflow has hand-written jobs.act locally, --debug re-run, tmate for interactive shells). Ghygen gives you no runtime visibility — that's expected, and another reason the YAML must be readable and hand-editable.How can I help you explore Laravel packages today?