Skip to content

Commit

Permalink
chore: Update pytestEnabled and search.useIgnoreFiles in .vscode/sett…
Browse files Browse the repository at this point in the history
…ings.json, update backendUrl in landing/src/services/contactService.js, update publish-profile in .github/workflows/azure-functions-app-python.yml, update REACT_APP_BACKEND_URL in .github/workflows/azure-staticwebapp.yml, and update terraform providers in infra/runtime/.terraform.lock.hcl
  • Loading branch information
ppokrovskii committed Jun 22, 2024
1 parent 228bcb8 commit b1cb8da
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/azure-functions-app-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
with:
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }} # Remove publish-profile to use Azure RBAC
publish-profile: ${{ secrets.AZFUNCTIONS_PUBLISHING_PROFILE }} # Remove publish-profile to use Azure RBAC
scm-do-build-during-deployment: false
enable-oryx-build: false
respect-funcignore: true
4 changes: 2 additions & 2 deletions .github/workflows/azure-staticwebapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ env:
APP_LOCATION: "/landing" # location of your client code
# API_LOCATION: "api" # location of your api source code - optional
APP_ARTIFACT_LOCATION: "build" # location of client code build output
AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing deployment token for your static web app
AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ secrets.LANDING_AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing deployment token for your static web app

permissions:
contents: read
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
app_build_command: 'npm run build' # Static Web App build command to embed environment variables
env: # Add environment variables here
REACT_APP_GA_MEASUREMENT_ID: ${{ secrets.REACT_APP_GA_MEASUREMENT_ID }}
REACT_APP_BACKEND_URL: ${{ vars.REACT_APP_BACKEND_URL }}
REACT_APP_BACKEND_URL: ${{ vars.LANDING_REACT_APP_BACKEND_URL }}
REACT_APP_ENV: ${{ github.ref_name == 'main' && 'prod' || 'dev' }} # Set the node environment to enable/disable google analytics

###### End of Repository/Build Configurations ######
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"."
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
"python.testing.pytestEnabled": true,
"search.useIgnoreFiles": false
}
22 changes: 0 additions & 22 deletions infra/runtime/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 38 additions & 3 deletions infra/runtime/github_actions_secrets.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
data "external" "publishing_profile" {
# get landing_publishing_profile
data "external" "landing_publishing_profile" {
program = ["powershell", "-File", "./fetch_publishing_profile.ps1", azurerm_linux_function_app.landing_backend.name, azurerm_resource_group.rg.name]

# No input is required, so this can be an empty map
Expand All @@ -7,7 +8,20 @@ data "external" "publishing_profile" {

# Convert the publishing profile from JSON string to raw string
locals {
publishing_profile = data.external.publishing_profile.result.publishing_profile
landing_publishing_profile = data.external.landing_publishing_profile.result.publishing_profile
}

# get azfunctions_publishing_profile
data "external" "azfunctions_publishing_profile" {
program = ["powershell", "-File", "./fetch_publishing_profile.ps1", azurerm_linux_function_app.resumematchpro.name, azurerm_resource_group.rg.name]

# No input is required, so this can be an empty map
query = {}
}

# Convert the publishing profile from JSON string to raw string
locals {
azfunctions_publishing_profile = data.external.azfunctions_publishing_profile.result.publishing_profile
}

data "github_repository" "repo" {
Expand All @@ -23,7 +37,28 @@ resource "github_actions_environment_secret" "LANDING_BACKEND_PUBLISHING_PROFILE
repository = data.github_repository.repo.name
environment = github_repository_environment.repo_environment.environment
secret_name = "LANDING_BACKEND_PUBLISHING_PROFILE"
plaintext_value = local.publishing_profile
plaintext_value = local.landing_publishing_profile
}

resource "github_actions_environment_secret" "AZFUNCTIONS_PUBLISHING_PROFILE" {
repository = data.github_repository.repo.name
environment = github_repository_environment.repo_environment.environment
secret_name = "AZFUNCTIONS_PUBLISHING_PROFILE"
plaintext_value = local.azfunctions_publishing_profile
}

resource "github_actions_environment_secret" "LANDING_AZURE_STATIC_WEB_APPS_API_TOKEN" {
repository = data.github_repository.repo.name
environment = github_repository_environment.repo_environment.environment
secret_name = "LANDING_AZURE_STATIC_WEB_APPS_API_TOKEN"
plaintext_value = azurerm_static_web_app.landingpage.api_key
}

resource "github_actions_environment_variable" "LANDING_REACT_APP_BACKEND_URL" {
repository = data.github_repository.repo.name
environment = github_repository_environment.repo_environment.environment
variable_name = "LANDING_REACT_APP_BACKEND_URL"
value = "https://${azurerm_linux_function_app.landing_backend.default_hostname}/api"
}

# data "github_repository" "repo" {
Expand Down
2 changes: 1 addition & 1 deletion landing/src/services/contactService.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const submitContactDetails = async (contactDetails) => {
const backendUrl = process.env.REACT_APP_BACKEND_URL;
const backendUrl = process.env.LANDING_REACT_APP_BACKEND_URL;
try {
const response = await fetch(`${backendUrl}/contact_details`, {
method: 'POST',
Expand Down

0 comments on commit b1cb8da

Please sign in to comment.