From 81f4fe52eb1f20920cc7dec5ab011a67ac8ebafe Mon Sep 17 00:00:00 2001 From: Dallas Fraser Date: Fri, 9 Feb 2024 19:20:06 -0500 Subject: [PATCH] Add an Github action for deploying to fly.io --- .github/workflows/deployment.yml | 16 ++++++------- deployments/fly-development.toml | 41 ++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 9 deletions(-) create mode 100644 deployments/fly-development.toml diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index db36329..8e071b9 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -1,17 +1,15 @@ -name: Deploy +name: Production Deployment to Fly.Io on: push: branches: - main - +env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} jobs: - build: + deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: akhileshns/heroku-deploy@v3.12.12 # This is the action - with: - heroku_api_key: ${{secrets.HEROKU_API_KEY}} - heroku_app_name: "waterloo-jam-league" #Must be unique in Heroku - heroku_email: "dallas.fraser.waterloo@gmail.com" \ No newline at end of file + - uses: actions/checkout@v2 + - uses: superfly/flyctl-actions/setup-flyctl@master + - run: flyctl deploy --remote-only --config ./deployments/fly-production.toml \ No newline at end of file diff --git a/deployments/fly-development.toml b/deployments/fly-development.toml new file mode 100644 index 0000000..ad20259 --- /dev/null +++ b/deployments/fly-development.toml @@ -0,0 +1,41 @@ +# fly.toml app configuration file generated for mlsb-development on 2023-05-28T20:49:38-04:00 +# +# See https://fly.io/docs/reference/configuration/ for information about how to use this file. +# + +app = "waterloo-jam-league" +kill_signal = "SIGINT" +kill_timeout = "5s" + +[experimental] + auto_rollback = true + +[build] + builder = "paketobuildpacks/builder:base" + +[env] + PORT = "8080" + +[[services]] + protocol = "tcp" + internal_port = 8080 + processes = ["app"] + + [[services.ports]] + port = 80 + handlers = ["http"] + force_https = true + + [[services.ports]] + port = 443 + handlers = ["tls", "http"] + [services.concurrency] + type = "connections" + hard_limit = 70 + soft_limit = 20 + + [[services.tcp_checks]] + interval = "15s" + timeout = "2s" + grace_period = "1s" + restart_limit = 0