Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Commit

Permalink
deploy on fly.io
Browse files Browse the repository at this point in the history
  • Loading branch information
akrantz01 committed Apr 21, 2023
1 parent 11f0103 commit 5d442ea
Show file tree
Hide file tree
Showing 4 changed files with 163 additions and 9 deletions.
34 changes: 25 additions & 9 deletions .github/workflows/containers.yml → .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
name: Docker
name: Deploy

on:
push:
branches:
- "**"
tags:
- "v*.*.*"
- push

jobs:
applications:
name: Applications
runs-on: ubuntu-20.04
containers:
name: Containers
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -77,3 +73,23 @@ jobs:
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
deploy:
name: Deploy
runs-on: ubuntu-22.04
needs: [containers]
if: github.ref == 'refs/heads/main'
strategy:
fail-fast: false
matrix:
app:
- api
- mjml
- tasks
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master

- run: flyctl deploy --remote-only -c fly.${{ matrix.app }}.toml
env:
FLY_API_TOKEN: ${{ secrets.FLY_TOKEN }}
59 changes: 59 additions & 0 deletions fly.api.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# fly.toml app configuration file generated for application-portal-api on 2023-04-19T15:16:22-07:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = "application-portal-api"
primary_region = "yyz"

[build]
image = "public.ecr.aws/wafflehacks/application-portal-api:main"

[deploy]
release_command = "migrate"
strategy = "rolling"

[env]
OTEL_ENABLE = "yes"
OTEL_DEBUG = "no"
OTEL_SERVICE_NAME = "application-portal/api"
OTEL_EXPORTER_OTLP_ENDPOINT = "https://api.honeycomb.io"

NATS_URL = "nats://wafflehacks-nats.internal:4222"

MJML_API = "http://application-portal-mjml.internal:8000"

APP_URL = "https://apply.wafflehacks.org"
PUBLIC_URL = "https://api.wafflehacks.org"

COOKIE_DOMAIN = "wafflehacks.org"
COOKIE_SECURE = "true"

[[services]]
internal_port = 8000
processes = ["app"]
protocol = "tcp"

[services.concurrency]
hard_limit = 250
soft_limit = 200
type = "requests"

[[services.ports]]
force_https = true
handlers = ["http"]
port = 80

[[services.ports]]
handlers = ["tls", "http"]
port = 443

[[services.http_checks]]
method = "get"
path = "/health"
protocol = "http"

grace_period = "20s"
interval = "15s"
restart_limit = 0
timeout = "3s"
35 changes: 35 additions & 0 deletions fly.mjml.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# fly.toml app configuration file generated for application-portal-mjml on 2023-04-19T16:11:33-07:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = "application-portal-mjml"
primary_region = "yyz"

[build]
image = "public.ecr.aws/wafflehacks/application-portal-mjml:main"

[deploy]
strategy = "rolling"

[env]
HOST = "0.0.0.0"
PORT = "8000"

OTEL_ENABLE = "yes"
OTEL_DEBUG = "no"
OTEL_SERVICE_NAME = "application-portal/mjml"
OTEL_EXPORTER_OTLP_ENDPOINT = "https://api.honeycomb.io"

[checks]
[checks.alive]
type = "http"
port = 8000
method = "get"
path = "/health"
protocol = "http"

grace_period = "15s"
interval = "15s"
restart_limit = 0
timeout = "3s"
44 changes: 44 additions & 0 deletions fly.tasks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# fly.toml app configuration file generated for application-portal-tasks on 2023-04-20T17:00:04-07:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = "application-portal-tasks"
primary_region = "yyz"

[build]
image = "public.ecr.aws/wafflehacks/application-portal-tasks:main"

[deploy]
strategy = "rolling"

[env]
LOG_LEVEL = "INFO"

NATS_URL = "nats://wafflehacks-nats.internal:4222"

MAILER_API = "http://wafflehacks-mailer.internal:8000"

SENDER = "apply@wafflehacks.org"
REPLY_TO = "team@wafflehacks.org"

HEALTHCHECK_HOST = "0.0.0.0"
HEALTHCHECK_PORT = "8000"

OTEL_ENABLE = "yes"
OTEL_DEBUG = "no"
OTEL_SERVICE_NAME = "application-portal/tasks"
OTEL_EXPORTER_OTLP_ENDPOINT = "https://api.honeycomb.io"

[checks]
[checks.alive]
type = "http"
port = 8000
method = "get"
path = "/health"
protocol = "http"

grace_period = "10s"
interval = "15s"
restart_limit = 0
timeout = "3s"

0 comments on commit 5d442ea

Please sign in to comment.