Skip to content

Commit e8038ee

Browse files
committed
chore: setup db file
1 parent 1c0472a commit e8038ee

File tree

3 files changed

+42
-17
lines changed

3 files changed

+42
-17
lines changed

.fly/scripts/2_database_init.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Add this below the storage folder initialization snippet
2+
FOLDER=/var/www/html/storage/database
3+
if [ ! -d "$FOLDER" ]; then
4+
echo "$FOLDER is not a directory, initializing database"
5+
mkdir /var/www/html/storage/database
6+
touch /var/www/html/storage/database/database.sqlite
7+
fi

.github/workflows/fly-deploy.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
2+
3+
name: Fly Deploy
4+
on:
5+
push:
6+
branches:
7+
- main
8+
jobs:
9+
deploy:
10+
name: Deploy app
11+
runs-on: ubuntu-latest
12+
concurrency: deploy-group # optional: ensure only one action runs at a time
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: superfly/flyctl-actions/setup-flyctl@master
16+
- run: flyctl deploy --remote-only
17+
env:
18+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

fly.toml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# fly.toml app configuration file generated for keza-starter-kit on 2024-10-16T00:42:10+02:00
1+
# fly.toml app configuration file generated for keza-starter-kit on 2024-10-20T17:07:58+02:00
22
#
33
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
44
#
@@ -12,44 +12,44 @@ console_command = 'php /var/www/html/artisan tinker'
1212
NODE_VERSION = '18'
1313
PHP_VERSION = '8.2'
1414

15+
[deploy]
16+
strategy = 'bluegreen'
17+
1518
[env]
1619
APP_ENV = 'production'
20+
DB_CONNECTION = 'sqlite'
21+
DB_DATABASE = '/var/www/html/storage/database/database.sqlite'
1722
LOG_CHANNEL = 'stderr'
1823
LOG_LEVEL = 'info'
1924
LOG_STDERR_FORMATTER = 'Monolog\Formatter\JsonFormatter'
2025
SESSION_DRIVER = 'cookie'
2126
SESSION_SECURE_COOKIE = 'true'
2227
SSR_URL = 'ssr.process.keza-starter-kit.internal:13714'
23-
DB_CONNECTION="sqlite"
24-
DB_DATABASE="/var/www/html/storage/database/database.sqlite"
2528

2629
[processes]
2730
app = ''
2831
ssr = 'php /var/www/html/artisan inertia:start-ssr'
2932

33+
[[mounts]]
34+
source = 'storage_dir'
35+
destination = '/var/www/html/storage'
36+
3037
[http_service]
3138
internal_port = 8080
3239
force_https = true
33-
auto_stop_machines = true
40+
auto_stop_machines = 'stop'
3441
auto_start_machines = true
3542
min_machines_running = 0
3643
processes = ['app']
3744

38-
[[http_service.checks]]
39-
grace_period = "10s"
40-
interval = "30s"
41-
method = "GET"
42-
timeout = "5s"
43-
path = "/"
45+
[[http_service.checks]]
46+
interval = '30s'
47+
timeout = '5s'
48+
grace_period = '10s'
49+
method = 'GET'
50+
path = '/'
4451

4552
[[vm]]
4653
memory = '512mb'
4754
cpu_kind = 'shared'
4855
cpus = 1
49-
50-
[mounts]
51-
source="storage_dir"
52-
destination="/var/www/html/storage"
53-
54-
[deploy]
55-
strategy = "bluegreen"

0 commit comments

Comments
 (0)