88 lines
2.8 KiB
Markdown
88 lines
2.8 KiB
Markdown
# Deployment Files
|
|
|
|
The hosting deployment is built by `scripts/build-deploy-artifact.sh` into `build/deploy/`.
|
|
|
|
Included:
|
|
|
|
- `app/`
|
|
- `bootstrap/`
|
|
- `public/`
|
|
- `routes/`
|
|
- `vendor/`
|
|
- `composer.json`
|
|
- `composer.lock`
|
|
- `spark`
|
|
- `preload.php`
|
|
- `writable/.htaccess`
|
|
- `writable/index.html`
|
|
- `writable/.gitkeep`
|
|
- `writable/*/.gitkeep`
|
|
- `writable/tcpdf_fonts/`
|
|
|
|
Excluded:
|
|
|
|
- `.git/`
|
|
- `.gitea/`
|
|
- `.env` and local env backups
|
|
- `tests/`
|
|
- `Database_Dump/`
|
|
- `build/` except the generated deploy artifact during CI
|
|
- documentation/planning files
|
|
- local scripts that are not needed at runtime
|
|
- runtime cache, logs, sessions, uploads, and generated reports
|
|
|
|
The server keeps its own `.env` and runtime `writable/` contents. The deploy job never overwrites those.
|
|
|
|
## Shared hosting layout
|
|
|
|
`.gitea/workflows/deploy.yml` deploys to Hostinger-style shared hosting, where the document root is `public_html` and the CodeIgniter application lives in a sibling directory:
|
|
|
|
```text
|
|
/home/USER/domains/home.alrahmaisgl.org/alrahma application (not web-accessible)
|
|
/home/USER/domains/home.alrahmaisgl.org/public_html document root (contents of public/)
|
|
```
|
|
|
|
`public_html/index.php` is patched to load:
|
|
|
|
```php
|
|
require FCPATH . '../alrahma/app/Config/Paths.php';
|
|
```
|
|
|
|
Existing `public_html/uploads`, `cgi-bin`, and `.well-known` are left in place.
|
|
|
|
## Gitea repository secrets
|
|
|
|
Required for SSH deploy:
|
|
|
|
- `DEPLOY_HOST` - SSH hostname from the Hostinger panel
|
|
- `DEPLOY_USER` - SSH username (for example `u280815660`)
|
|
- `DEPLOY_SSH_KEY` - private key whose public half is in Hostinger SSH Access
|
|
- `DEPLOY_APP_PATH` - application directory, for example `/home/u280815660/domains/home.alrahmaisgl.org/alrahma`
|
|
|
|
Optional:
|
|
|
|
- `DEPLOY_PUBLIC_PATH` - document root. Defaults to a sibling `public_html` next to `DEPLOY_APP_PATH`, for example `/home/u280815660/domains/home.alrahmaisgl.org/public_html`
|
|
- `DEPLOY_PORT` - defaults to `65002` (Hostinger SSH). Use `22` only if the host uses the standard port.
|
|
- `DEPLOY_PHP_BIN` - defaults to `/opt/alt/php85/usr/bin/php`
|
|
- `DEPLOY_INDEX_REQUIRE` - defaults to `../alrahma/app/Config/Paths.php`
|
|
- `DEPLOY_PATH` - fallback for `DEPLOY_APP_PATH` if the newer secret is not set
|
|
|
|
Create `.env` once on the server under `DEPLOY_APP_PATH`. Do not put database or mail passwords in the workflow.
|
|
|
|
## Gitea Package
|
|
|
|
The deploy workflow also archives `build/deploy/` and publishes it to Gitea Packages when package credentials are present:
|
|
|
|
- Package name: `alrahma_sunday_school`
|
|
- Version format: `{branch}-{run_number}-{short_sha}`
|
|
- File format: `alrahma_sunday_school-{version}.tar.gz`
|
|
|
|
Optional package secrets:
|
|
|
|
- `GITEAPACKAGEUSER`
|
|
- `GITEAPACKAGETOKEN`
|
|
- `GITEA_BASE_URL` - defaults to `https://192.168.3.80`
|
|
- `GITEA_PACKAGE_OWNER` - defaults to `melabidi`
|
|
|
|
The token must have permission to publish packages for the package owner.
|