Skip to content

Commit

Permalink
fix deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
hluu0 committed Oct 18, 2024
1 parent c9e03c0 commit cd95cf7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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: |
Expand Down
3 changes: 2 additions & 1 deletion terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down

0 comments on commit cd95cf7

Please sign in to comment.