Skip to content

Commit 80c80c8

Browse files
committed
feat: update README for Azure App Service and Static Web Apps; add Node version for build process and clarify deployment steps
1 parent 0dbed2e commit 80c80c8

2 files changed

Lines changed: 69 additions & 2 deletions

File tree

04-cloud/azure/paas/02-app-service/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ az webapp deployment source config-zip \
139139
--src site.zip \
140140
--resource-group $RESOURCE_GROUP \
141141
--name $WEB_API_NAME
142+
143+
142144
```
143145

144146
**En Windows PowerShell:**
@@ -173,7 +175,7 @@ Una vez completado, verifica que todo funcionó correctamente:
173175

174176
```bash
175177
echo "✅ API deployed successfully!"
176-
echo "📍 API URL: https://$WEB_API_NAME.azurewebsites.net"
178+
echo "📍 API URL: https://$WEB_API_NAME.azurewebsites.net/api/hero"
177179
```
178180

179181
## ➡️ Siguiente paso

04-cloud/azure/paas/03-static-web-apps/README.md

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,74 @@ Abre el workflow en GitHub y modifica el paso **Build And Deploy** con lo siguie
117117
app_build_command: API_URL=${{ secrets.API_URL}} npm run build-with-api-url
118118
app_location: "/"
119119
api_location: ""
120-
output_location: "dist/angular-tour-of-heroes"
120+
output_location: "dist/angular-tour-of-heroes/browser"
121121
```
122122
123+
Importante! El flujo que crea Static Web Apps se apoya en Node 18 pero nuestra app usa Node 20 por lo que también es necesario añadir como variable
124+
```yaml
125+
- name: Build And Deploy
126+
id: builddeploy
127+
uses: Azure/static-web-apps-deploy@v1
128+
env:
129+
NODE_VERSION: 20
130+
```
131+
132+
el YAML final quedaría así:
133+
134+
```yaml
135+
name: Azure Static Web Apps CI/CD
136+
137+
on:
138+
push:
139+
branches:
140+
- main
141+
pull_request:
142+
types: [opened, synchronize, reopened, closed]
143+
branches:
144+
- main
145+
146+
jobs:
147+
build_and_deploy_job:
148+
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
149+
runs-on: ubuntu-latest
150+
name: Build and Deploy Job
151+
steps:
152+
- uses: actions/checkout@v3
153+
with:
154+
submodules: true
155+
lfs: false
156+
- name: Build And Deploy
157+
id: builddeploy
158+
uses: Azure/static-web-apps-deploy@v1
159+
env:
160+
NODE_VERSION: 20 # 🆕 Nuevo incluido por mi
161+
with:
162+
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GENTLE_BAY_033E22103 }}
163+
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
164+
action: 'upload'
165+
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
166+
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
167+
app_location: '/' # App source code path
168+
api_location: '' # Api source code path - optional
169+
output_location: 'dist/angular-tour-of-heroes/browser' # Built app content directory - optional
170+
app_build_command: API_URL=${{ secrets.API_URL}} npm run build-with-api-url
171+
###### End of Repository/Build Configurations ######
172+
173+
close_pull_request_job:
174+
if: github.event_name == 'pull_request' && github.event.action == 'closed'
175+
runs-on: ubuntu-latest
176+
name: Close Pull Request Job
177+
steps:
178+
- name: Close Pull Request
179+
id: closepullrequest
180+
uses: Azure/static-web-apps-deploy@v1
181+
with:
182+
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GENTLE_BAY_033E22103 }}
183+
action: 'close'
184+
185+
```
186+
187+
123188
### ¿Qué cambió?
124189

125190
Solo añadimos la propiedad `app_build_command` que:

0 commit comments

Comments
 (0)