Skip to content

Commit

Permalink
chore(ci): add fly.io
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdip-b committed Feb 6, 2024
1 parent 0daeff3 commit 46bcd22
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/apps/api

deploy-stage:
runs-on: ubuntu-latest
name: Deploy to stage

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install fly CLI
run: curl -L https://fly.io/install.sh | sh
- name: Deploy to stage
run: fly deploy --config fly.api.toml --dockerfile ./apps/api/Dockerfile --app keyshade-api-stage --access-token ${{ secrets.FLY_ACCESS_TOKEN }}

build-api-alpha:
needs: validate
runs-on: ubuntu-latest
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ jobs:
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

deploy-stage:
runs-on: ubuntu-latest
name: Deploy to stage

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install fly CLI
run: curl -L https://fly.io/install.sh | sh
- name: Deploy to stage
run: fly deploy --config fly.web.toml --dockerfile ./apps/web/Dockerfile --app keyshade-web --access-token ${{ secrets.FLY_ACCESS_TOKEN }}

build-web-alpha:
needs: validate
runs-on: ubuntu-latest
Expand Down
33 changes: 33 additions & 0 deletions fly.api.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
primary_region = "bom"

[http_service]
internal_port = 4200
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
[http_service.concurrency]
type = "requests"
soft_limit = 200
hard_limit = 250

[http_service.tls_options]
alpn = ["h2", "http/1.1"]
versions = ["TLSv1.2", "TLSv1.3"]
default_self_signed = true

[[http_service.checks]]
grace_period = "10s"
interval = "30s"
method = "GET"
timeout = "10s"
path = "/api/health"
protocol = "http"
port = 4200
tls_skip_verify = true

[[vm]]
size = "shared-cpu-1x"
memory = "512mb"
cpus = 1
cpu_kind = "shared"
23 changes: 23 additions & 0 deletions fly.web.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
primary_region = "bom"

[http_service]
internal_port = 3000
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
[http_service.concurrency]
type = "requests"
soft_limit = 200
hard_limit = 250

[http_service.tls_options]
alpn = ["h2", "http/1.1"]
versions = ["TLSv1.2", "TLSv1.3"]
default_self_signed = true

[[vm]]
size = "shared-cpu-1x"
memory = "256mb"
cpus = 1
cpu_kind = "shared"

0 comments on commit 46bcd22

Please sign in to comment.