-
Notifications
You must be signed in to change notification settings - Fork 13
/
azure.yaml
42 lines (40 loc) · 1.54 KB
/
azure.yaml
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
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json
name: todo-java-mongo-aca
metadata:
template: [email protected]
workflows:
up:
steps:
- azd: provision
- azd: deploy --all
services:
web:
project: ./src/web
language: js
host: containerapp
api:
project: ./src/api
language: java
host: containerapp
# using predeploy hook for web until
# https://github.com/Azure/azure-dev/issues/3546 is fixed
hooks:
# Creates a temporary `.env.local` file for the build command. Vite will automatically use it during build.
# The expected/required values are mapped to the infrastructure outputs.
# .env.local is ignored by git, so it will not be committed if, for any reason, if deployment fails.
# see: https://vitejs.dev/guide/env-and-mode
# Note: Notice that dotenv must be a project dependency for this to work. See package.json.
predeploy:
windows:
shell: pwsh
run: 'echo "VITE_API_BASE_URL=""$env:API_BASE_URL""" > ./src/web/.env.local ; echo "VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=""$env:APPLICATIONINSIGHTS_CONNECTION_STRING""" >> ./src/web/.env.local'
posix:
shell: sh
run: 'echo VITE_API_BASE_URL=\"$API_BASE_URL\" > ./src/web/.env.local && echo VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$APPLICATIONINSIGHTS_CONNECTION_STRING\" >> ./src/web/.env.local'
postdeploy:
windows:
shell: pwsh
run: 'rm ./src/web/.env.local'
posix:
shell: sh
run: 'rm ./src/web/.env.local'