You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of polluting each GitHub Reposity with multiple App-specific GitHub Action Secrets, you can save all your secrets in a single `APPSETTINGS_PATCH` GitHub Action Secret to patch `appsettings.json` with environment-specific configuration using [JSON Patch](https://jsonpatch.com). E.g:
2. Install `db-identity` to use RDBMS `DatabaseJobsFeature` for background jobs and `DbRequestLogger` for Request Logs:
289
-
290
-
```bash
291
-
npx add-in db-identity
292
-
```
293
-
294
-
## Deployment
295
-
296
-
### Docker + Kamal
297
-
298
-
This project includes GitHub Actions for CI/CD with automatic Docker image builds and production [deployment with Kamal](https://docs.servicestack.net/kamal-deploy). The `/config/deploy.yml` configuration is designed to be reusable across projects—it dynamically derives service names, image paths, and volume mounts from environment variables, so you only need to configure your server's IP and hostname using GitHub Action secrets.
299
-
300
-
### GitHub Action Secrets
301
-
302
-
**Required - App Specific*:
303
-
304
-
The only secret needed to be configured per Repository.
305
-
306
-
| Variable | Example | Description |
307
-
|----------|---------|-------------|
308
-
|`KAMAL_DEPLOY_HOST`|`example.org`| Hostname used for SSL certificate and Kamal proxy |
309
-
310
-
**Required** (Organization Secrets):
311
-
312
-
Other Required variables can be globally configured in your GitHub Organization or User secrets which will
313
-
enable deploying all your Repositories to the same server.
314
-
315
-
| Variable | Example | Description |
316
-
|----------|----------|-------------|
317
-
|`KAMAL_DEPLOY_IP`|`100.100.100.100`| IP address of the server to deploy to |
318
-
|`SSH_PRIVATE_KEY`|`ssh-rsa ...`| SSH private key to access the server |
319
-
|`LETSENCRYPT_EMAIL`|`[email protected]`| Email for Let's Encrypt SSL certificate |
These are inferred from the GitHub Action context and don't need to be configured.
330
-
331
-
| Variable | Source | Description |
332
-
|----------|--------|-------------|
333
-
|`GITHUB_REPOSITORY`|`${{ github.repository }}`| e.g. `acme/example.org` - used for service name and image |
334
-
|`KAMAL_REGISTRY_USERNAME`|`${{ github.actor }}`| GitHub username for container registry |
335
-
|`KAMAL_REGISTRY_PASSWORD`|`${{ secrets.GITHUB_TOKEN }}`| GitHub token for container registry auth |
336
-
337
-
#### Features
338
-
339
-
-**Docker containerization** with optimized .NET images
340
-
-**SSL auto-certification** via Let's Encrypt
341
-
-**GitHub Container Registry** integration
342
-
-**Volume persistence** for App_Data including any SQLite database
343
-
344
-
345
-
## AutoQuery CRUD Dev Workflow
346
-
347
-
For Rapid Development simple [TypeScript Data Models](https://docs.servicestack.net/autoquery/okai-models) can be used to generate C# AutoQuery APIs and DB Migrations.
348
-
349
-
### Cheat Sheet
350
-
351
-
Create a new Table use `init <Table>`, e.g:
352
-
353
-
```bash
354
-
npx okai init Table
355
-
```
356
-
357
-
This will generate an empty `MyApp.ServiceModel/<Table>.d.ts` file along with stub AutoQuery APIs and DB Migration implementations.
358
-
359
-
#### Regenerate AutoQuery APIs and DB Migrations
360
-
361
-
After modifying the TypeScript Data Model to include the desired fields, re-run the `okai` tool to re-generate the AutoQuery APIs and DB Migrations:
362
-
363
-
```bash
364
-
npx okai Table.d.ts
365
-
```
366
-
367
-
> Command can be run anywhere within your Solution
368
-
369
-
After you're happy with your Data Model you can run DB Migrations to run the DB Migration and create your RDBMS Table:
370
-
371
-
```bash
372
-
npm run migrate
373
-
```
374
-
375
-
#### Making changes after first migration
376
-
377
-
If you want to make further changes to your Data Model, you can re-run the `okai` tool to update the AutoQuery APIs and DB Migrations, then run the `rerun:last` npm script to drop and re-run the last migration:
378
-
379
-
```bash
380
-
npm run rerun:last
381
-
```
382
-
383
-
#### Removing a Data Model and all generated code
384
-
385
-
If you changed your mind and want to get rid of the RDBMS Table you can revert the last migration:
386
-
387
-
```bash
388
-
npm run revert:last
389
-
```
390
-
391
-
Which will drop the table and then you can get rid of the AutoQuery APIs, DB Migrations and TypeScript Data model with:
0 commit comments