Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add VITE_CLERK_PUBLISHABLE_KEY and refine terraform code for release #220

Merged
merged 4 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion terraform/Amplify/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "aws_amplify_app" "main" {
name = "restaking-dashboard"
name = "restaking-dashboard-app"
repository = "https://github.com/NethermindEth/restaking-dashboard"

environment_variables = {
Expand All @@ -16,11 +16,21 @@ resource "aws_amplify_app" "main" {
status = "200"
target = "/index.html"
}

}

resource "aws_amplify_branch" "main" {
app_id = aws_amplify_app.main.id
branch_name = "main"
stage = "DEVELOPMENT"

enable_auto_build = false
PhilexWong marked this conversation as resolved.
Show resolved Hide resolved
}

# Release branch for production environment
resource "aws_amplify_branch" "release" {
app_id = aws_amplify_app.main.id
branch_name = "release/v0.1.0"
stage = "PRODUCTION"

enable_auto_build = false
Expand All @@ -37,6 +47,21 @@ resource "aws_amplify_domain_association" "main" {
branch_name = aws_amplify_branch.main.branch_name
prefix = "stage"
}

# add this for pre-production domain
# https://prod.restaking.info
sub_domain {
branch_name = aws_amplify_branch.release.branch_name
prefix = "prod"
}

# add this for production domain
# https://restaking.info
sub_domain {
branch_name = aws_amplify_branch.release.branch_name
prefix = ""
}

}


Expand All @@ -46,3 +71,9 @@ resource "aws_amplify_webhook" "stage" {
description = "stage"
}


resource "aws_amplify_webhook" "release" {
app_id = aws_amplify_app.main.id
branch_name = aws_amplify_branch.release.branch_name
description = "release"
}
8 changes: 8 additions & 0 deletions terraform/Amplify/output.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

output "aws_amplify_domain_association" {
value = aws_amplify_domain_association.main.sub_domain
}

output "aws_amplify_webhook"{
value = aws_amplify_webhook.stage.url
}