From 26bef2356538084095ca8b73d1c11d9eae7075b4 Mon Sep 17 00:00:00 2001 From: yujonglee Date: Tue, 25 Jun 2024 21:58:32 +0900 Subject: [PATCH] deploy hosted version to fly --- .github/workflows/deploy_cloud.yaml | 15 +++++++++++++ core/debug.sh | 5 +++++ core/fly.toml | 33 +++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 .github/workflows/deploy_cloud.yaml create mode 100644 core/debug.sh create mode 100644 core/fly.toml diff --git a/.github/workflows/deploy_cloud.yaml b/.github/workflows/deploy_cloud.yaml new file mode 100644 index 00000000..2c94bf10 --- /dev/null +++ b/.github/workflows/deploy_cloud.yaml @@ -0,0 +1,15 @@ +--- +on: + release: + types: + - published +jobs: + deploy: + runs-on: ubuntu-latest + concurrency: deploy-group + steps: + - uses: actions/checkout@v4 + - uses: superfly/flyctl-actions/setup-flyctl@master + - run: flyctl deploy --remote-only + env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/core/debug.sh b/core/debug.sh new file mode 100644 index 00000000..353c980c --- /dev/null +++ b/core/debug.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +set -e + +fly ssh console --pty --select -C "/app/bin/canary remote" diff --git a/core/fly.toml b/core/fly.toml new file mode 100644 index 00000000..a556311b --- /dev/null +++ b/core/fly.toml @@ -0,0 +1,33 @@ +# fly.toml app configuration file generated for fastrepl on 2024-06-25T17:02:24+09:00 +# +# See https://fly.io/docs/reference/configuration/ for information about how to use this file. +# + +app = 'canary-prod' +primary_region = 'sjc' +kill_signal = 'SIGTERM' + +[build] + dockerfile = 'Dockerfile' + +[env] + PHX_HOST = 'cloud.getcanary.dev' + PORT = '8080' + +[http_service] + internal_port = 8080 + force_https = true + auto_stop_machines = true + auto_start_machines = true + min_machines_running = 1 + processes = ['app'] + + [http_service.concurrency] + type = 'connections' + hard_limit = 1000 + soft_limit = 1000 + +[[vm]] + memory = '1gb' + cpu_kind = 'shared' + cpus = 1