Issue
Have a Static Web App (SWA) with integrated API, Azure has auto-gen a .github/workflows/azure-static-web-apps-xxx.yml
file for master
branch.
As I'm reading Angular's Building and serving that each environment should have its specific build like ng build --configuration production
so this will take place
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
Although .yml has no build
command, I found GitHub, Action tab, Build and Deploy Job log shows
...
56 Running 'npm install --unsafe-perm'...
...
86 > ui@0.0.0 build /github/workspace
87 > ng build
...
Without --configuration production
line 87 will build a "development" by default and push to Azure.
Is there any way I can add a such configuration in .yml file?
Solution
.yml
builds PRODUCTION.
It's easy to check if your API have any reference to process.env
as DEV stores them in local.settings.json
but Azure Portal for PRODUCTION, or front-end's environment.ts
vs. environment.production.ts
in src\environments folder
Answered By - Jeb50
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.