Skip to content

Commit

Permalink
Add Vercel terraform provider
Browse files Browse the repository at this point in the history
  • Loading branch information
katyabilokur committed Aug 20, 2024
1 parent aafdf31 commit 1ed6620
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/infrastructure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on: push

env:
GOOGLE_BACKEND_CREDENTIALS: ${{ secrets.GOOGLE_BACKEND_CREDENTIALS }}
VERCEL_API_TOKEN: ${{ secrets.VERCEL_API_TOKEN }}

defaults:
run:
Expand Down
26 changes: 23 additions & 3 deletions terraform/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
resource "null_resource" "default" {
provisioner "local-exec" {
command = "echo 'Hello World'"
resource "vercel_project_domain" "default" {
project_id = vercel_project.this.id
domain = "katya-terraform.vercel.app"
}

resource "vercel_project" "this" {
name = "terraform-project"
framework = "nextjs"

git_repository = {
type = "github"
repo = "katyabilokur/nextjs-vercel-supabase-boilerplate"
}
}

data "vercel_project_directory" "this" {
path = "../"
}

resource "vercel_deployment" "this" {
project_id = vercel_project.this.id
files = data.vercel_project_directory.this.files
path_prefix = data.vercel_project_directory.this.path
production = true
}
1 change: 1 addition & 0 deletions terraform/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
provider "vercel" {}
4 changes: 4 additions & 0 deletions terraform/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@ terraform {
source = "hashicorp/random"
version = "3.6.2"
}
vercel = {
source = "vercel/vercel"
version = "1.12.0"
}
}
}

0 comments on commit 1ed6620

Please sign in to comment.