From cd95cf7caec21d139b7dfd45da6220dd941496c3 Mon Sep 17 00:00:00 2001 From: Hans Luu Date: Fri, 18 Oct 2024 14:35:45 +0200 Subject: [PATCH] fix deployment --- .github/workflows/deploy.yml | 9 +++++++++ terraform/main.tf | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e462c4b..2a89607 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -16,11 +16,17 @@ jobs: uses: actions/checkout@v4 # Task 1.1: + - name: Install Dependencies + run: yarn install + + - name: Run Tests + run: yarn test deploy-infrastructure: name: Deploy infrastructure with Terraform runs-on: ubuntu-latest # Task 1.2: + needs: frontend-tests env: TF_VAR_my_name: ${{ github.head_ref }} ARM_CLIENT_ID: ${{ vars.ARM_CLIENT_ID }} @@ -55,6 +61,9 @@ jobs: # Task 2.3: + - name: Run Terraform apply + run: terraform apply -auto-approve + - name: Get Terraform output id: terraform-output run: | diff --git a/terraform/main.tf b/terraform/main.tf index 71ba965..bedf8c8 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -9,7 +9,8 @@ resource "azurerm_resource_group" "devops" { resource "azurerm_static_web_app" "devops" { name = "${var.my_name}-webapp" - # Task 2.2: + resource_group_name = azurerm_resource_group.devops.name + location = azurerm_resource_group.devops.location } output "resource_group_name" {