- Deployments run through GitHub Actions + Deployer 8 (
.github/workflows/deploy.yml,deploy.php,deploy/custom.php).deploy.ymlcallsdeploy-environment.ymlfor each environment. - Tests:
.github/workflows/tests.ymlruns Pest on every pull request intomainordevelopment, along with Pint on the changed files andcomposer audit. Every deploy runs the tests first and stops if they fail. The tests use SQLite in memory and no built assets (withoutMix()intests/TestCase.php). - Production: pushing or merging to
mainruns the tests, calculates the next version, deploys to production (3.142.169.134), and creates a GitHub release with notes listing the pull requests since the previous release. Add[skip deploy]or[no deploy]to the commit message to push without deploying. - Development: pushes to
developmentdon't deploy. Run the workflow manually (Actions → Build and Deploy → Run workflow →development) to deploy to the development server (3.138.217.206). - Only one deploy runs at a time per branch; a second one waits.
- The deploy trusts only the SSH host keys in
.github/known_hosts. If a server's keys change, regenerate the file withssh-keyscan -t ed25519,ecdsa,rsa <ip>after checking the fingerprints. - Dependabot (
.github/dependabot.yml) opens weekly update pull requests intodevelopmentfor GitHub Actions, Composer and npm. - Assets are built in CI and downloaded as an artifact; the server doesn't build them.
- Releases live under
/data/web/digitizationacademy/releases/<n>, withcurrentpointing at the active one. Both servers serve it with PHP 8.5 (php8.5-fpm). - nginx passes PHP the resolved release path (
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;andfastcgi_param DOCUMENT_ROOT $realpath_root;afterinclude fastcgi_params;), so a new release is served without an OPcache reset. Keep both lines in the site config on each server. - Queues run under Horizon (Supervisor program
da:da-horizon_00). After a deploy, checkphp artisan horizon:statusand thathorizon:workprocesses stay up, not just that Supervisor shows RUNNING.
- Templates live in
resources/supervisor/*.conf. During deploy,php artisan app:deploy-files --current-path={{current_path}}renders them intostorage/app/supervisor/(shared storage), which Supervisor includes on each server. It fills:{{APP_CURRENT_PATH}}:--current-path, or the app's base path when omitted (/data/web/digitizationacademy/currenton servers){{APP_ENV}},{{APP_TAG}},{{APP_SERVER_USER}}:config('app.env'),config('app.tag'),config('app.server_user')
- Because Horizon runs from
current, the rendered file doesn't change between deploys.artisan:horizon:terminateruns afterdeploy:publish, and Supervisor restarts Horizon on the new release. - Run
php artisan app:deploy-files --dry-runto see where files would be written without changing anything.
- The server's
.envis generated from AWS SSM Parameter Store (/digitizationacademy/<environment>) on every deploy by theenv:ssmtask from the shared deployer-recipes package (set('ssm_app', 'digitizationacademy')indeploy.php). It keeps the last 5.env.backup.*files inshared/. - Manage the parameters from your machine:
vendor/bin/push-env-params digitizationacademy <development|production>pushes.env.aws.<environment>to SSM.vendor/bin/remove-env-params digitizationacademy <development|production>deletes every parameter under that path, after you type the environment name to confirm.
- Keep
.env.aws.*files out of git (covered by.gitignore).
DigitizationAcademy is open-sourced software licensed under GNU General Public License v3.0.
Translation by https://translation.io