Deploy application code to production
- Build frontend application (dist/ ready) - Build Function App API (TypeScript compiled) - Fix staticwebapp.config.json (node:20 instead of node:22) - Add deployment documentation and instructions Ready for automatic deployment via GitHub Actions
This commit is contained in:
120
docs/deployment/DEPLOYMENT_INSTRUCTIONS.md
Normal file
120
docs/deployment/DEPLOYMENT_INSTRUCTIONS.md
Normal file
@@ -0,0 +1,120 @@
|
||||
# 🚀 Application Deployment Instructions
|
||||
|
||||
**Date:** November 12, 2025
|
||||
**Status:** Deployment in progress
|
||||
|
||||
---
|
||||
|
||||
## Current Status
|
||||
|
||||
### ✅ Completed
|
||||
- Frontend built successfully (dist/ directory ready)
|
||||
- Function App API built successfully
|
||||
- Configuration fixed (node:20 instead of node:22)
|
||||
|
||||
### ⚠️ Pending
|
||||
- Static Web App deployment (SWA CLI having config issues)
|
||||
- Function App deployment (needs zip package)
|
||||
|
||||
---
|
||||
|
||||
## Recommended Deployment Method: GitHub Actions
|
||||
|
||||
The most reliable way to deploy is via GitHub Actions. If you have a workflow configured:
|
||||
|
||||
```bash
|
||||
# Commit and push to trigger deployment
|
||||
git add .
|
||||
git commit -m "Deploy application to production"
|
||||
git push origin main
|
||||
```
|
||||
|
||||
This will automatically:
|
||||
- Build frontend
|
||||
- Build API
|
||||
- Deploy to Static Web App
|
||||
- Deploy Function App functions
|
||||
- Run tests
|
||||
|
||||
---
|
||||
|
||||
## Alternative: Azure Portal Deployment
|
||||
|
||||
### Static Web App
|
||||
|
||||
1. Go to: https://portal.azure.com
|
||||
2. Navigate to: **Static Web App** → `mim-prod-igiay4-web`
|
||||
3. Go to: **Deployment Center**
|
||||
4. Choose: **Upload** or **Connect to GitHub**
|
||||
5. Upload the `dist/` folder contents or connect your repository
|
||||
|
||||
### Function App
|
||||
|
||||
1. Go to: https://portal.azure.com
|
||||
2. Navigate to: **Function App** → `mim-prod-igiay4-func`
|
||||
3. Go to: **Deployment Center**
|
||||
4. Choose: **Upload** or **Connect to GitHub**
|
||||
5. Upload the built API code from `api/src/`
|
||||
|
||||
---
|
||||
|
||||
## Manual Deployment Commands
|
||||
|
||||
### Static Web App (if SWA CLI works)
|
||||
|
||||
```bash
|
||||
# Get deployment token
|
||||
DEPLOY_TOKEN=$(az staticwebapp secrets list \
|
||||
--name mim-prod-igiay4-web \
|
||||
--resource-group rg-miraclesinmotion-prod \
|
||||
--query "properties.apiKey" -o tsv)
|
||||
|
||||
# Deploy
|
||||
npx @azure/static-web-apps-cli deploy ./dist \
|
||||
--env production \
|
||||
--deployment-token "$DEPLOY_TOKEN"
|
||||
```
|
||||
|
||||
### Function App (if func CLI available)
|
||||
|
||||
```bash
|
||||
cd api
|
||||
func azure functionapp publish mim-prod-igiay4-func
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Configuration Issues Fixed
|
||||
|
||||
### staticwebapp.config.json
|
||||
- Changed `apiRuntime` from `node:22` to `node:20`
|
||||
- This is required as Azure Static Web Apps doesn't support Node.js 22 yet
|
||||
|
||||
---
|
||||
|
||||
## Verification
|
||||
|
||||
After deployment, verify:
|
||||
|
||||
```bash
|
||||
# Check Static Web App
|
||||
curl -I https://lemon-water-015cb3010.3.azurestaticapps.net
|
||||
|
||||
# Check Function App
|
||||
curl -I https://mim-prod-igiay4-func.azurewebsites.net
|
||||
```
|
||||
|
||||
The Static Web App should show your React application, not the Azure default page.
|
||||
|
||||
---
|
||||
|
||||
## Next Steps
|
||||
|
||||
1. **Recommended:** Push to GitHub to trigger automatic deployment
|
||||
2. **Alternative:** Use Azure Portal to upload files manually
|
||||
3. **Verify:** Test endpoints after deployment
|
||||
|
||||
---
|
||||
|
||||
**For issues, see:** `docs/deployment/DEPLOYMENT_ATTEMPT_LOG.md`
|
||||
|
||||
Reference in New Issue
Block a user