-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add deployment solution to digital ocean app platform (#430)
- Loading branch information
1 parent
c61e5e6
commit 4589e2e
Showing
15 changed files
with
141 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,15 @@ jobs: | |
pass: ${{ secrets.DOCKER_PASSWORD }} | ||
slug: asyncapi/server-api | ||
description: Server API providing official AsyncAPI tools | ||
|
||
deploy-app: | ||
name: Deploy to DigitalOcean App | ||
needs: publish-docker | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy to DigitalOcean App | ||
uses: digitalocean/[email protected] | ||
with: | ||
app_name: "server-api" | ||
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | ||
images: '[{"name":"asyncapi-server-api","image":{"registry_type":"DOCKER_HUB","registry":"asyncapi","repository":"server-api","tag":"latest"}}]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.terraform | ||
terraform.tfstate | ||
terraform.tfstate.backup |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
terraform { | ||
required_version = ">= 1.0.0" | ||
|
||
required_providers { | ||
digitalocean = { | ||
source = "digitalocean/digitalocean" | ||
version = ">= 2.0.0" | ||
} | ||
} | ||
} | ||
|
||
provider "digitalocean" {} | ||
|
||
resource "digitalocean_app" "server-api" { | ||
spec { | ||
name = "server-api" | ||
region = "sfo3" | ||
|
||
domain { | ||
name = "api.asyncapi.com" | ||
type = "PRIMARY" | ||
} | ||
|
||
ingress { | ||
rule { | ||
component { | ||
name = "asyncapi-server-api" | ||
} | ||
match { | ||
path { | ||
prefix = "/" | ||
} | ||
} | ||
cors { | ||
allow_origins { | ||
exact = "*" | ||
} | ||
allow_methods = ["GET", "POST", "PUT", "DELETE", "OPTIONS"] | ||
allow_headers = ["*"] | ||
} | ||
} | ||
} | ||
|
||
service { | ||
name = "asyncapi-server-api" | ||
http_port = 80 | ||
health_check { | ||
http_path = "/v1/help/validate" | ||
port = 80 | ||
} | ||
env { | ||
key = "PORT" | ||
value = "80" | ||
} | ||
|
||
image { | ||
registry_type = "DOCKER_HUB" | ||
registry = "asyncapi" | ||
repository = "server-api" | ||
tag = "latest" | ||
} | ||
|
||
instance_count = 1 | ||
instance_size_slug = "basic-xs" // $10/month | ||
|
||
alert { | ||
rule = "CPU_UTILIZATION" | ||
value = 80 | ||
operator = "GREATER_THAN" | ||
window = "TEN_MINUTES" | ||
} | ||
} | ||
|
||
alert { | ||
rule = "DEPLOYMENT_FAILED" | ||
} | ||
} | ||
} | ||
|
||
output "live_url" { | ||
value = digitalocean_app.server-api.default_ingress | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.