Skip to content

Commit

Permalink
Deploy attempts (#5)
Browse files Browse the repository at this point in the history
* retry

* lets try this

* no build

* na most eskü

* in reverse i guess?

* maybe now

* eee

* next try

* dont tell me that an env var...

* finalize
  • Loading branch information
Tschonti authored May 4, 2024
1 parent 85f225a commit ce6276d
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 81 deletions.
13 changes: 0 additions & 13 deletions .funcignore

This file was deleted.

58 changes: 30 additions & 28 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,39 @@ on:
- master

jobs:
# terraform:
# name: Setup infrastructure in Azure with Terraform
# defaults:
# run:
# working-directory: 'infra'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: hashicorp/setup-terraform@v3
# with:
# cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
terraform:
name: Setup infrastructure in Azure with Terraform
defaults:
run:
working-directory: 'infra'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
with:
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}

# - name: Terraform fmt
# id: fmt
# run: terraform fmt -check
# continue-on-error: true
- name: Terraform fmt
id: fmt
run: terraform fmt -check
continue-on-error: true

# - name: Terraform Init
# id: init
# run: terraform init
- name: Terraform Init
id: init
run: terraform init

# - name: Terraform Validate
# id: validate
# run: terraform validate -no-color
- name: Terraform Validate
id: validate
run: terraform validate -no-color

# - name: Terraform Apply
# id: apply
# run: terraform apply -no-color -auto-approve
# continue-on-error: true
- name: Terraform Apply
id: apply
run: terraform apply -no-color -auto-approve
continue-on-error: true

deploy_fa:
name: Deploy backend code to Azure Function App
# needs: terraform
needs: terraform
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
Expand All @@ -52,16 +52,18 @@ jobs:
- name: 'Resolve Project Dependencies Using Npm'
shell: bash
run: |
npm i @nx/[email protected] @nx/[email protected] @nx/[email protected] @nxazure/func@^1.0.17 [email protected]
npx nx build functions
cd packages/functions
npm ci
cd packages/functions && npm run build
- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: fa
with:
respect-funcignore: true
app-name: pontozo-api-tf
package: .
package: packages/functions
publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }}

# deploy_aswa:
Expand Down
14 changes: 6 additions & 8 deletions infra/functionapp.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,11 @@ resource "azurerm_windows_function_app" "function-app" {
}

app_settings = {
"ADMINS" = var.FA_ADMINS
"APIM_HOST" = azurerm_api_management.apim.gateway_url
"APIM_KEY" = ""
"CLIENT_ID" = var.MTFSZ_CLIENT_ID
"CLIENT_SECRET" = var.MTFSZ_CLIENT_SECRET
# "DB_ADMIN_PWD" = ""
# "DB_ADMIN_USER" = ""
"ADMINS" = var.FA_ADMINS
"APIM_HOST" = azurerm_api_management.apim.gateway_url
"APIM_KEY" = ""
"CLIENT_ID" = var.MTFSZ_CLIENT_ID
"CLIENT_SECRET" = var.MTFSZ_CLIENT_SECRET
"DB_NAME" = azurerm_mssql_database.sqldatabase.name
"DB_PWD" = var.DB_PWD
"DB_SERVER" = azurerm_mssql_server.sqlserver.fully_qualified_domain_name
Expand All @@ -67,7 +65,7 @@ resource "azurerm_windows_function_app" "function-app" {
"FUNCTIONS_WORKER_RUNTIME" = "node"
"JWT_SECRET" = var.FA_JWT_SECRET
"REDIS_HOST" = "TODO"
"REDIS_PORT" = "TODO"
"REDIS_PORT" = 0
"REDIS_PWD" = "TODO"
"WEBSITE_RUN_FROM_PACKAGE" = 1
"WEBSITE_TIME_ZONE" = "Central Europe Standard Time"
Expand Down
7 changes: 1 addition & 6 deletions packages/functions/.funcignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
*.js.map
*.ts
.git*
.vscode
local.settings.json
test
.env
node_modules/@types/
node_modules/azure-functions-core-tools/
node_modules/typescript/
packages/client/
packages/common/
docs/
infra/
58 changes: 32 additions & 26 deletions packages/functions/package-lock.json

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

0 comments on commit ce6276d

Please sign in to comment.