diff --git a/.github/workflows/api.yaml b/.github/workflows/api.yaml index 5bbad867..0a5d79b2 100644 --- a/.github/workflows/api.yaml +++ b/.github/workflows/api.yaml @@ -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 diff --git a/.github/workflows/web.yaml b/.github/workflows/web.yaml index c8af925b..b231b9ed 100644 --- a/.github/workflows/web.yaml +++ b/.github/workflows/web.yaml @@ -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 diff --git a/fly.api.toml b/fly.api.toml new file mode 100644 index 00000000..bf6b3b3b --- /dev/null +++ b/fly.api.toml @@ -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" diff --git a/fly.web.toml b/fly.web.toml new file mode 100644 index 00000000..3b373ec9 --- /dev/null +++ b/fly.web.toml @@ -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"