Skip to content

Commit cd5dcae

Browse files
committed
Add Fly.io CI/CD deployment
1 parent ddbacc1 commit cd5dcae

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

.github/workflows/deploy-fly.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Deploy to Fly.io
2+
3+
on:
4+
push:
5+
branches: [cicd] # Change to [master] after testing
6+
workflow_dispatch: # Allow manual trigger
7+
8+
jobs:
9+
deploy:
10+
name: Deploy app
11+
runs-on: ubuntu-latest
12+
concurrency: deploy-group
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup Fly CLI
17+
uses: superfly/flyctl-actions/setup-flyctl@master
18+
19+
- name: Deploy to Fly
20+
run: flyctl deploy --remote-only
21+
env:
22+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

fly.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
app = 'readykit'
2+
primary_region = 'iad'
3+
4+
[build]
5+
6+
[env]
7+
FLASK_APP = "run.py"
8+
FLASK_DEBUG = "0"
9+
PORT = "5000"
10+
11+
[http_service]
12+
internal_port = 5000
13+
force_https = true
14+
auto_stop_machines = 'stop'
15+
auto_start_machines = true
16+
min_machines_running = 0
17+
processes = ['app']
18+
19+
[[http_service.checks]]
20+
grace_period = "10s"
21+
interval = "30s"
22+
method = "GET"
23+
timeout = "5s"
24+
path = "/"
25+
26+
[[vm]]
27+
memory = '512mb'
28+
cpu_kind = 'shared'
29+
cpus = 1

0 commit comments

Comments
 (0)