Skip to content

finalize page

finalize page #96

Workflow file for this run

name: Deploy to Azure
on:
push:
branches:
- 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 }}
- name: Terraform fmt
id: fmt
run: terraform fmt -check
continue-on-error: true
- name: Terraform Init
id: init
run: terraform init
- name: Terraform Validate
id: validate
run: terraform validate -no-color
- name: Terraform Apply
id: apply
run: terraform apply -no-color -auto-approve
deploy_fa:
name: Deploy backend code to Azure Function App
needs: terraform
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v4
- name: Setup Node 20 Environment
uses: actions/setup-node@v4
with:
node-version: 20
- 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]
cd packages/functions
npm ci
cd ../common
npm ci
cd ../..
npx nx build functions
- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: fa
with:
respect-funcignore: true
app-name: pontozoapi
package: packages/functions
publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }}
deploy_aswa:
needs: terraform
runs-on: ubuntu-latest
name: Build and Deploy client to Azure Static Web Apps
env:
VITE_FUNC_HOST: ${{ secrets.FUNC_HOST }}
VITE_APIM_HOST: ${{ secrets.APIM_HOST }}
VITE_MTFSZ_API_URL: ${{ secrets.MTFSZ_API_URL }}
VITE_APIM_KEY: ${{ secrets.APIM_KEY }}
VITE_CLIENT_ID: ${{ secrets.CLIENT_ID }}
VITE_APP_INSIGHTS_CONN_STR: ${{ secrets.APP_INSIGHTS_CONN_STR}}
steps:
- uses: actions/checkout@v4
with:
submodules: false
lfs: false
- name: 'Resolve common Dependencies Using Npm'
shell: bash
run: |
cd packages/common
npm ci
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{secrets.SWA_API_KEY}}
action: 'upload'
app_location: '.' # App source code path
output_location: '/packages/client/dist' # Built app content directory - optional