-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (83 loc) · 2.79 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Deploy Infrastructure
on:
push:
branches:
- master
env:
AZURE_FUNCTIONAPP_NAME: 'pontozo-api-tf'
AZURE_FUNCTIONAPP_PACKAGE_PATH: './packages/functions'
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
continue-on-error: true
deploy_fa:
name: Deploy backend code to Azure Function App
needs: terraform
runs-on: windows-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v4
- name: Setup Node 18 Environment
uses: actions/setup-node@v4
with:
node-version: 18
- name: 'Resolve Project Dependencies Using Npm'
shell: pwsh
run: |
pushd ./packages/common
npm ci
popd
pushd '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
npm ci
npm run build --if-present
popd
- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: fa
with:
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
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
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: false
# lfs: false
# - name: Build And Deploy
# id: builddeploy
# uses: Azure/static-web-apps-deploy@v1
# with:
# azure_static_web_apps_api_token: ${{secrets.SWA_API_KEY}}
# repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
# action: "upload"
# ###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
# app_location: "." # App source code path
# output_location: "/dist" # Built app content directory - optional
# ###### End of Repository/Build Configurations ######