From 13d9e3ee1f6571a55aefb1703e2536ff1baa1eaf Mon Sep 17 00:00:00 2001 From: crawfordkid2 Date: Thu, 28 May 2026 12:10:56 -0700 Subject: [PATCH 01/11] Add interactive customer robot map --- frontend/customer-webapp/package-lock.json | 7 + frontend/customer-webapp/package.json | 1 + frontend/customer-webapp/src/pages/Home.jsx | 273 +++++++++++++++++++- 3 files changed, 274 insertions(+), 7 deletions(-) diff --git a/frontend/customer-webapp/package-lock.json b/frontend/customer-webapp/package-lock.json index 5e8c6f4..91ba7f2 100644 --- a/frontend/customer-webapp/package-lock.json +++ b/frontend/customer-webapp/package-lock.json @@ -8,6 +8,7 @@ "name": "frontend", "version": "0.0.0", "dependencies": { + "leaflet": "^1.9.4", "react": "^19.2.6", "react-dom": "^19.2.6", "react-router-dom": "^7.15.1" @@ -1605,6 +1606,12 @@ "json-buffer": "3.0.1" } }, + "node_modules/leaflet": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.9.4.tgz", + "integrity": "sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA==", + "license": "BSD-2-Clause" + }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", diff --git a/frontend/customer-webapp/package.json b/frontend/customer-webapp/package.json index b4ec813..940e9be 100644 --- a/frontend/customer-webapp/package.json +++ b/frontend/customer-webapp/package.json @@ -10,6 +10,7 @@ "preview": "vite preview" }, "dependencies": { + "leaflet": "^1.9.4", "react": "^19.2.6", "react-dom": "^19.2.6", "react-router-dom": "^7.15.1" diff --git a/frontend/customer-webapp/src/pages/Home.jsx b/frontend/customer-webapp/src/pages/Home.jsx index 0b2437b..62852a0 100644 --- a/frontend/customer-webapp/src/pages/Home.jsx +++ b/frontend/customer-webapp/src/pages/Home.jsx @@ -1,8 +1,14 @@ import { Link } from "react-router-dom" -import { useEffect, useMemo, useState } from "react" +import { useEffect, useMemo, useRef, useState } from "react" +import L from "leaflet" +import "leaflet/dist/leaflet.css" const SIMULATOR_API_BASE = import.meta.env.VITE_SIMULATOR_API_BASE || "/api/simulator" +const MAP_TILE_URL = + import.meta.env.VITE_MAP_TILE_URL || + "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" +const SPOKANE_CENTER = [47.6588, -117.426] const demoBots = [ { @@ -10,8 +16,8 @@ const demoBots = [ model: "DeliveryBot-V1", status: "Available", currentLocation: { - latitude: 33.4255, - longitude: -111.94 + latitude: 47.6588, + longitude: -117.426 }, powerLevel: 99.9, externalTemperature: 72, @@ -31,8 +37,8 @@ const demoBots = [ model: "DeliveryBot-V1", status: "OnDelivery", currentLocation: { - latitude: 33.4261, - longitude: -111.9394 + latitude: 47.6572, + longitude: -117.4236 }, powerLevel: 86.4, externalTemperature: 71, @@ -46,8 +52,8 @@ const demoBots = [ model: "DeliveryBot-V1", status: "Charging", currentLocation: { - latitude: 33.4248, - longitude: -111.9408 + latitude: 47.6605, + longitude: -117.4145 }, powerLevel: 24.6, externalTemperature: 72, @@ -171,6 +177,8 @@ export default function Home() { + +
{displayedBots.map((bot) => ( @@ -199,6 +207,164 @@ function Metric({ label, value }) { ) } +function FleetMap({ bots, isDemoData }) { + const mapElementRef = useRef(null) + const mapRef = useRef(null) + const markerLayerRef = useRef(null) + const hasFitMapRef = useRef(false) + const lastBotIdsRef = useRef("") + const locatedBots = useMemo( + () => + bots.filter( + (bot) => + Number.isFinite(bot.currentLocation?.latitude) && + Number.isFinite(bot.currentLocation?.longitude) + ), + [bots] + ) + + useEffect(() => { + if (!mapElementRef.current || mapRef.current) { + return undefined + } + + const map = L.map(mapElementRef.current, { + center: SPOKANE_CENTER, + zoom: 15, + minZoom: 12, + maxZoom: 19, + scrollWheelZoom: true + }) + + L.tileLayer(MAP_TILE_URL, { + attribution: + '© OpenStreetMap contributors', + detectRetina: true, + keepBuffer: 3, + updateWhenIdle: true + }).addTo(map) + + mapRef.current = map + markerLayerRef.current = L.layerGroup().addTo(map) + + window.setTimeout(() => map.invalidateSize(), 0) + + return () => { + map.remove() + mapRef.current = null + markerLayerRef.current = null + hasFitMapRef.current = false + lastBotIdsRef.current = "" + } + }, []) + + useEffect(() => { + const map = mapRef.current + const markerLayer = markerLayerRef.current + + if (!map || !markerLayer) { + return + } + + markerLayer.clearLayers() + + if (locatedBots.length === 0) { + map.setView(SPOKANE_CENTER, 15) + return + } + + locatedBots.forEach((bot) => { + const statusColor = getStatusColor(bot.status) + const marker = L.circleMarker( + [bot.currentLocation.latitude, bot.currentLocation.longitude], + { + radius: 10, + color: statusColor.background, + fillColor: statusColor.text, + fillOpacity: 1, + opacity: 1, + weight: 4 + } + ) + + marker + .bindTooltip(`${bot.botId} - ${formatStatus(bot.status || "Unknown")}`, { + direction: "top", + offset: [0, -10], + opacity: 0.95 + }) + .addTo(markerLayer) + }) + + const botIds = locatedBots + .map((bot) => bot.botId) + .sort() + .join("|") + + if (!hasFitMapRef.current || lastBotIdsRef.current !== botIds) { + const bounds = L.latLngBounds( + locatedBots.map((bot) => [ + bot.currentLocation.latitude, + bot.currentLocation.longitude + ]) + ) + + map.fitBounds(bounds.pad(0.35), { + maxZoom: 16 + }) + hasFitMapRef.current = true + lastBotIdsRef.current = botIds + } + }, [locatedBots]) + + return ( +
+
+
+

Fleet map

+

Robot Locations

+
+ + + {locatedBots.length} mapped robot{locatedBots.length === 1 ? "" : "s"} + +
+ +
+
+ +
+ {["Available", "OnDelivery", "Charging"].map((status) => { + const statusColor = getStatusColor(status) + + return ( +
+ + {formatStatus(status)} +
+ ) + })} +
+
+ + {isDemoData && ( +

+ Demo coordinates are shown until simulator data is available. +

+ )} +
+ ) +} + function BotCard({ bot, isDemoData }) { const statusColor = getStatusColor(bot.status) const location = bot.currentLocation @@ -299,6 +465,14 @@ function getStockSummary(stock = []) { .join(", ") } +function formatStatus(status) { + if (status === "OnDelivery") { + return "On delivery" + } + + return status +} + function getStatusColor(status) { if (status === "Available") { return { @@ -468,6 +642,91 @@ const styles = { marginTop: "0.3rem" }, + mapPanel: { + backgroundColor: "#f8fafc", + border: "1px solid #cbd5e1", + borderRadius: "8px", + color: "#0f172a", + marginBottom: "1rem", + padding: "1rem", + textAlign: "left" + }, + + mapHeader: { + display: "flex", + justifyContent: "space-between", + alignItems: "flex-start", + gap: "1rem", + marginBottom: "1rem", + flexWrap: "wrap" + }, + + mapTitle: { + color: "#0f172a", + fontSize: "1.35rem", + lineHeight: 1.2, + margin: 0 + }, + + mapCount: { + color: "#475569", + backgroundColor: "#e2e8f0", + border: "1px solid #cbd5e1", + borderRadius: "999px", + padding: "0.4rem 0.7rem", + fontSize: "0.82rem", + fontWeight: "bold" + }, + + mapShell: { + display: "flex", + flexDirection: "column", + gap: "1rem", + alignItems: "stretch" + }, + + mapCanvas: { + height: "430px", + minHeight: "360px", + overflow: "hidden", + borderRadius: "8px", + border: "1px solid #bfdbfe", + backgroundColor: "#e2e8f0" + }, + + mapLegend: { + display: "flex", + flexWrap: "wrap", + gap: "0.7rem", + backgroundColor: "#f1f5f9", + border: "1px solid #cbd5e1", + borderRadius: "8px", + padding: "1rem", + minHeight: "auto" + }, + + legendItem: { + display: "flex", + alignItems: "center", + gap: "0.55rem", + color: "#334155", + fontSize: "0.9rem", + fontWeight: "bold" + }, + + legendDot: { + width: "0.8rem", + height: "0.8rem", + borderRadius: "999px", + flex: "0 0 auto" + }, + + mapFootnote: { + color: "#64748b", + fontSize: "0.85rem", + marginTop: "0.85rem" + }, + botGrid: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))", From 08a35d6b80b5a4f5143b8fa1b802d7e11afae8ad Mon Sep 17 00:00:00 2001 From: crawfordkid2 Date: Thu, 28 May 2026 15:10:16 -0700 Subject: [PATCH 02/11] Add Azure deployment workflow for customer webapp --- .github/workflows/deploy-customer-webapp.yml | 57 ++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/deploy-customer-webapp.yml diff --git a/.github/workflows/deploy-customer-webapp.yml b/.github/workflows/deploy-customer-webapp.yml new file mode 100644 index 0000000..4f56091 --- /dev/null +++ b/.github/workflows/deploy-customer-webapp.yml @@ -0,0 +1,57 @@ +name: Deploy customer webapp to Azure + +on: + push: + branches: + - main + - customer-map + paths: + - "frontend/customer-webapp/**" + - ".github/workflows/deploy-customer-webapp.yml" + workflow_dispatch: + +permissions: + contents: read + +jobs: + build-and-deploy: + name: Build and deploy customer webapp + runs-on: ubuntu-latest + + defaults: + run: + working-directory: frontend/customer-webapp + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + cache-dependency-path: frontend/customer-webapp/package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Lint customer webapp + run: npm run lint + + - name: Build customer webapp + run: npm run build + env: + VITE_MAP_TILE_URL: ${{ vars.VITE_MAP_TILE_URL }} + VITE_SIMULATOR_API_BASE: ${{ vars.VITE_SIMULATOR_API_BASE }} + + - name: Deploy to Azure Static Web Apps + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} + repo_token: ${{ secrets.GITHUB_TOKEN }} + action: upload + app_location: frontend/customer-webapp/dist + api_location: "" + output_location: "" + skip_app_build: true From d70de83cfbb9cf562a045fcb58a60f5c9dd21615 Mon Sep 17 00:00:00 2001 From: crawfordkid2 Date: Thu, 28 May 2026 15:23:25 -0700 Subject: [PATCH 03/11] Use App Service workflow for customer webapp deploy --- .../workflows/CustomerWebpage-Deploy-WF.yml | 29 ++++++++-- .github/workflows/deploy-customer-webapp.yml | 57 ------------------- 2 files changed, 25 insertions(+), 61 deletions(-) delete mode 100644 .github/workflows/deploy-customer-webapp.yml diff --git a/.github/workflows/CustomerWebpage-Deploy-WF.yml b/.github/workflows/CustomerWebpage-Deploy-WF.yml index 231850a..a244054 100644 --- a/.github/workflows/CustomerWebpage-Deploy-WF.yml +++ b/.github/workflows/CustomerWebpage-Deploy-WF.yml @@ -1,12 +1,27 @@ name: CustomerWebpage-Deploy-WF on: + push: + branches: + - main + - customer-map + paths: + - "frontend/customer-webapp/**" + - ".github/workflows/CustomerWebpage-Deploy-WF.yml" workflow_dispatch: +permissions: + contents: read + jobs: build-and-deploy: + name: Build and deploy customer web app runs-on: ubuntu-latest + defaults: + run: + working-directory: frontend/customer-webapp + steps: - name: Checkout repository uses: actions/checkout@v4 @@ -15,18 +30,24 @@ jobs: uses: actions/setup-node@v4 with: node-version: '22.x' + cache: npm + cache-dependency-path: frontend/customer-webapp/package-lock.json - name: Install dependencies - working-directory: ./frontend - run: npm install + run: npm ci + + - name: Lint React app + run: npm run lint - name: Build React app - working-directory: ./frontend run: npm run build + env: + VITE_MAP_TILE_URL: ${{ vars.VITE_MAP_TILE_URL }} + VITE_SIMULATOR_API_BASE: ${{ vars.VITE_SIMULATOR_API_BASE }} - name: Deploy to Azure Web App uses: azure/webapps-deploy@v3 with: app-name: 'WA-DeliveryBot-dev' publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_1BA6A9C76C684517B5106BD8ACF4CE5B }} - package: ./frontend/dist + package: frontend/customer-webapp/dist diff --git a/.github/workflows/deploy-customer-webapp.yml b/.github/workflows/deploy-customer-webapp.yml deleted file mode 100644 index 4f56091..0000000 --- a/.github/workflows/deploy-customer-webapp.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Deploy customer webapp to Azure - -on: - push: - branches: - - main - - customer-map - paths: - - "frontend/customer-webapp/**" - - ".github/workflows/deploy-customer-webapp.yml" - workflow_dispatch: - -permissions: - contents: read - -jobs: - build-and-deploy: - name: Build and deploy customer webapp - runs-on: ubuntu-latest - - defaults: - run: - working-directory: frontend/customer-webapp - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: npm - cache-dependency-path: frontend/customer-webapp/package-lock.json - - - name: Install dependencies - run: npm ci - - - name: Lint customer webapp - run: npm run lint - - - name: Build customer webapp - run: npm run build - env: - VITE_MAP_TILE_URL: ${{ vars.VITE_MAP_TILE_URL }} - VITE_SIMULATOR_API_BASE: ${{ vars.VITE_SIMULATOR_API_BASE }} - - - name: Deploy to Azure Static Web Apps - uses: Azure/static-web-apps-deploy@v1 - with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} - repo_token: ${{ secrets.GITHUB_TOKEN }} - action: upload - app_location: frontend/customer-webapp/dist - api_location: "" - output_location: "" - skip_app_build: true From 734de6e03b14233656d4f30d29173ebaa7028b6b Mon Sep 17 00:00:00 2001 From: crawfordkid2 Date: Thu, 28 May 2026 15:26:59 -0700 Subject: [PATCH 04/11] Validate customer webapp publish profile secret --- .../workflows/CustomerWebpage-Deploy-WF.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CustomerWebpage-Deploy-WF.yml b/.github/workflows/CustomerWebpage-Deploy-WF.yml index a244054..807583c 100644 --- a/.github/workflows/CustomerWebpage-Deploy-WF.yml +++ b/.github/workflows/CustomerWebpage-Deploy-WF.yml @@ -17,6 +17,10 @@ jobs: build-and-deploy: name: Build and deploy customer web app runs-on: ubuntu-latest + env: + AZURE_WEBAPP_NAME: WA-DeliveryBot-dev + AZURE_WEBAPP_PACKAGE_PATH: frontend/customer-webapp/dist + AZURE_WEBAPP_PUBLISH_PROFILE: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_1BA6A9C76C684517B5106BD8ACF4CE5B || secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} defaults: run: @@ -45,9 +49,18 @@ jobs: VITE_MAP_TILE_URL: ${{ vars.VITE_MAP_TILE_URL }} VITE_SIMULATOR_API_BASE: ${{ vars.VITE_SIMULATOR_API_BASE }} + - name: Validate Azure publish profile + working-directory: . + run: | + if [ -z "$AZURE_WEBAPP_PUBLISH_PROFILE" ]; then + echo "Azure App Service publish profile secret is missing." + echo "Add either AZUREAPPSERVICE_PUBLISHPROFILE_1BA6A9C76C684517B5106BD8ACF4CE5B or AZURE_WEBAPP_PUBLISH_PROFILE as a GitHub Actions repository secret." + exit 1 + fi + - name: Deploy to Azure Web App uses: azure/webapps-deploy@v3 with: - app-name: 'WA-DeliveryBot-dev' - publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_1BA6A9C76C684517B5106BD8ACF4CE5B }} - package: frontend/customer-webapp/dist + app-name: ${{ env.AZURE_WEBAPP_NAME }} + publish-profile: ${{ env.AZURE_WEBAPP_PUBLISH_PROFILE }} + package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} From f140bdeecdde062504d88df9ebe526f968aa13bc Mon Sep 17 00:00:00 2001 From: crawfordkid2 <114096196+crawfordkid2@users.noreply.github.com> Date: Thu, 28 May 2026 15:29:43 -0700 Subject: [PATCH 05/11] updating workflow --- .../workflows/CustomerWebpage-Deploy-WF.yml | 92 ++++++++----------- 1 file changed, 38 insertions(+), 54 deletions(-) diff --git a/.github/workflows/CustomerWebpage-Deploy-WF.yml b/.github/workflows/CustomerWebpage-Deploy-WF.yml index 807583c..bd48e3a 100644 --- a/.github/workflows/CustomerWebpage-Deploy-WF.yml +++ b/.github/workflows/CustomerWebpage-Deploy-WF.yml @@ -1,66 +1,50 @@ name: CustomerWebpage-Deploy-WF on: - push: - branches: - - main - - customer-map - paths: - - "frontend/customer-webapp/**" - - ".github/workflows/CustomerWebpage-Deploy-WF.yml" - workflow_dispatch: +push: +branches: +- main +- customer-map +paths: +- "frontend/customer-webapp/**" +- ".github/workflows/CustomerWebpage-Deploy-WF.yml" -permissions: - contents: read +workflow_dispatch: jobs: - build-and-deploy: - name: Build and deploy customer web app - runs-on: ubuntu-latest - env: - AZURE_WEBAPP_NAME: WA-DeliveryBot-dev - AZURE_WEBAPP_PACKAGE_PATH: frontend/customer-webapp/dist - AZURE_WEBAPP_PUBLISH_PROFILE: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_1BA6A9C76C684517B5106BD8ACF4CE5B || secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} - - defaults: - run: - working-directory: frontend/customer-webapp +build-and-deploy: +runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 +``` +defaults: + run: + working-directory: frontend/customer-webapp - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '22.x' - cache: npm - cache-dependency-path: frontend/customer-webapp/package-lock.json +steps: + - name: Checkout repository + uses: actions/checkout@v4 - - name: Install dependencies - run: npm ci + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22.x' - - name: Lint React app - run: npm run lint + - name: Install dependencies + run: npm ci - - name: Build React app - run: npm run build - env: - VITE_MAP_TILE_URL: ${{ vars.VITE_MAP_TILE_URL }} - VITE_SIMULATOR_API_BASE: ${{ vars.VITE_SIMULATOR_API_BASE }} + - name: Lint application + run: npm run lint - - name: Validate Azure publish profile - working-directory: . - run: | - if [ -z "$AZURE_WEBAPP_PUBLISH_PROFILE" ]; then - echo "Azure App Service publish profile secret is missing." - echo "Add either AZUREAPPSERVICE_PUBLISHPROFILE_1BA6A9C76C684517B5106BD8ACF4CE5B or AZURE_WEBAPP_PUBLISH_PROFILE as a GitHub Actions repository secret." - exit 1 - fi - - - name: Deploy to Azure Web App - uses: azure/webapps-deploy@v3 - with: - app-name: ${{ env.AZURE_WEBAPP_NAME }} - publish-profile: ${{ env.AZURE_WEBAPP_PUBLISH_PROFILE }} - package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} + - name: Build application + run: npm run build + env: + VITE_MAP_TILE_URL: ${{ vars.VITE_MAP_TILE_URL }} + VITE_SIMULATOR_API_BASE: ${{ vars.VITE_SIMULATOR_API_BASE }} + + - name: Deploy to Azure Web App + uses: azure/webapps-deploy@v3 + with: + app-name: WA-DeliveryBot-dev + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_1BA6A9C76C684517B5106BD8ACF4CE5B }} + package: frontend/customer-webapp/dist +``` From 2b4341713f5869d92f18dc114038fc53ceb32331 Mon Sep 17 00:00:00 2001 From: crawfordkid2 Date: Thu, 28 May 2026 15:32:11 -0700 Subject: [PATCH 06/11] Simplify customer webapp deployment workflow --- .../workflows/CustomerWebpage-Deploy-WF.yml | 90 +++++++++---------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/.github/workflows/CustomerWebpage-Deploy-WF.yml b/.github/workflows/CustomerWebpage-Deploy-WF.yml index bd48e3a..810ecac 100644 --- a/.github/workflows/CustomerWebpage-Deploy-WF.yml +++ b/.github/workflows/CustomerWebpage-Deploy-WF.yml @@ -1,50 +1,50 @@ name: CustomerWebpage-Deploy-WF on: -push: -branches: -- main -- customer-map -paths: -- "frontend/customer-webapp/**" -- ".github/workflows/CustomerWebpage-Deploy-WF.yml" - -workflow_dispatch: + push: + branches: + - main + - customer-map + paths: + - "frontend/customer-webapp/**" + - ".github/workflows/CustomerWebpage-Deploy-WF.yml" + workflow_dispatch: + +permissions: + contents: read jobs: -build-and-deploy: -runs-on: ubuntu-latest - -``` -defaults: - run: - working-directory: frontend/customer-webapp - -steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '22.x' - - - name: Install dependencies - run: npm ci - - - name: Lint application - run: npm run lint - - - name: Build application - run: npm run build - env: - VITE_MAP_TILE_URL: ${{ vars.VITE_MAP_TILE_URL }} - VITE_SIMULATOR_API_BASE: ${{ vars.VITE_SIMULATOR_API_BASE }} - - - name: Deploy to Azure Web App - uses: azure/webapps-deploy@v3 - with: - app-name: WA-DeliveryBot-dev - publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_1BA6A9C76C684517B5106BD8ACF4CE5B }} - package: frontend/customer-webapp/dist -``` + build-and-deploy: + runs-on: ubuntu-latest + + defaults: + run: + working-directory: frontend/customer-webapp + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22.x' + + - name: Install dependencies + run: npm ci + + - name: Lint application + run: npm run lint + + - name: Build application + run: npm run build + env: + VITE_MAP_TILE_URL: ${{ vars.VITE_MAP_TILE_URL }} + VITE_SIMULATOR_API_BASE: ${{ vars.VITE_SIMULATOR_API_BASE }} + + - name: Deploy to Azure Web App + uses: azure/webapps-deploy@v3 + with: + app-name: WA-DeliveryBot-dev + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_1BA6A9C76C684517B5106BD8ACF4CE5B }} + package: frontend/customer-webapp/dist From 97a1e8abe7f9b91285e09ef15c6b43c0713a1c14 Mon Sep 17 00:00:00 2001 From: crawfordkid2 Date: Thu, 28 May 2026 15:41:59 -0700 Subject: [PATCH 07/11] Use Azure login for customer webapp deployment --- .github/workflows/CustomerWebpage-Deploy-WF.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CustomerWebpage-Deploy-WF.yml b/.github/workflows/CustomerWebpage-Deploy-WF.yml index 810ecac..fd1ec7e 100644 --- a/.github/workflows/CustomerWebpage-Deploy-WF.yml +++ b/.github/workflows/CustomerWebpage-Deploy-WF.yml @@ -12,6 +12,7 @@ on: permissions: contents: read + id-token: write jobs: build-and-deploy: @@ -42,9 +43,15 @@ jobs: VITE_MAP_TILE_URL: ${{ vars.VITE_MAP_TILE_URL }} VITE_SIMULATOR_API_BASE: ${{ vars.VITE_SIMULATOR_API_BASE }} + - name: Azure Login + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + - name: Deploy to Azure Web App uses: azure/webapps-deploy@v3 with: app-name: WA-DeliveryBot-dev - publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_1BA6A9C76C684517B5106BD8ACF4CE5B }} package: frontend/customer-webapp/dist From af6d7ac0a55db50a62b0cd4c9479520f86ca77cb Mon Sep 17 00:00:00 2001 From: crawfordkid2 Date: Thu, 28 May 2026 15:45:04 -0700 Subject: [PATCH 08/11] Deploy customer webapp only from main --- .github/workflows/CustomerWebpage-Deploy-WF.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/CustomerWebpage-Deploy-WF.yml b/.github/workflows/CustomerWebpage-Deploy-WF.yml index fd1ec7e..ee1081e 100644 --- a/.github/workflows/CustomerWebpage-Deploy-WF.yml +++ b/.github/workflows/CustomerWebpage-Deploy-WF.yml @@ -44,6 +44,7 @@ jobs: VITE_SIMULATOR_API_BASE: ${{ vars.VITE_SIMULATOR_API_BASE }} - name: Azure Login + if: github.ref == 'refs/heads/main' uses: azure/login@v2 with: client-id: ${{ secrets.AZURE_CLIENT_ID }} @@ -51,6 +52,7 @@ jobs: subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Deploy to Azure Web App + if: github.ref == 'refs/heads/main' uses: azure/webapps-deploy@v3 with: app-name: WA-DeliveryBot-dev From 2e60fad87b113840445fed531bc10d591b5be90f Mon Sep 17 00:00:00 2001 From: crawfordkid2 <114096196+crawfordkid2@users.noreply.github.com> Date: Tue, 2 Jun 2026 11:21:17 -0700 Subject: [PATCH 09/11] fixing deployment workflow --- .github/workflows/CustomerWebpage-Deploy-WF.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CustomerWebpage-Deploy-WF.yml b/.github/workflows/CustomerWebpage-Deploy-WF.yml index ee1081e..ccec039 100644 --- a/.github/workflows/CustomerWebpage-Deploy-WF.yml +++ b/.github/workflows/CustomerWebpage-Deploy-WF.yml @@ -5,9 +5,11 @@ on: branches: - main - customer-map + - Customer-Facing-Website paths: - "frontend/customer-webapp/**" - ".github/workflows/CustomerWebpage-Deploy-WF.yml" + workflow_dispatch: permissions: @@ -44,7 +46,6 @@ jobs: VITE_SIMULATOR_API_BASE: ${{ vars.VITE_SIMULATOR_API_BASE }} - name: Azure Login - if: github.ref == 'refs/heads/main' uses: azure/login@v2 with: client-id: ${{ secrets.AZURE_CLIENT_ID }} @@ -52,7 +53,6 @@ jobs: subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Deploy to Azure Web App - if: github.ref == 'refs/heads/main' uses: azure/webapps-deploy@v3 with: app-name: WA-DeliveryBot-dev From 53bcb3240e4f1571116003f55bdf511b495262a7 Mon Sep 17 00:00:00 2001 From: crawfordkid2 <114096196+crawfordkid2@users.noreply.github.com> Date: Tue, 2 Jun 2026 11:28:58 -0700 Subject: [PATCH 10/11] Update deployment workflow for Azure this will only deploy on main --- .github/workflows/CustomerWebpage-Deploy-WF.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CustomerWebpage-Deploy-WF.yml b/.github/workflows/CustomerWebpage-Deploy-WF.yml index ccec039..e0b1fac 100644 --- a/.github/workflows/CustomerWebpage-Deploy-WF.yml +++ b/.github/workflows/CustomerWebpage-Deploy-WF.yml @@ -5,7 +5,6 @@ on: branches: - main - customer-map - - Customer-Facing-Website paths: - "frontend/customer-webapp/**" - ".github/workflows/CustomerWebpage-Deploy-WF.yml" @@ -46,6 +45,7 @@ jobs: VITE_SIMULATOR_API_BASE: ${{ vars.VITE_SIMULATOR_API_BASE }} - name: Azure Login + if: github.ref == 'refs/heads/main' uses: azure/login@v2 with: client-id: ${{ secrets.AZURE_CLIENT_ID }} @@ -53,6 +53,7 @@ jobs: subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Deploy to Azure Web App + if: github.ref == 'refs/heads/main' uses: azure/webapps-deploy@v3 with: app-name: WA-DeliveryBot-dev From 3b0d34250c9fafa090c9aae215a3177c084c177f Mon Sep 17 00:00:00 2001 From: crawfordkid2 <114096196+crawfordkid2@users.noreply.github.com> Date: Tue, 2 Jun 2026 14:37:45 -0700 Subject: [PATCH 11/11] Update deployment workflow for pull requests --- .github/workflows/CustomerWebpage-Deploy-WF.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CustomerWebpage-Deploy-WF.yml b/.github/workflows/CustomerWebpage-Deploy-WF.yml index e0b1fac..aafb9fa 100644 --- a/.github/workflows/CustomerWebpage-Deploy-WF.yml +++ b/.github/workflows/CustomerWebpage-Deploy-WF.yml @@ -4,7 +4,13 @@ on: push: branches: - main - - customer-map + paths: + - "frontend/customer-webapp/**" + - ".github/workflows/CustomerWebpage-Deploy-WF.yml" + + pull_request: + branches: + - main paths: - "frontend/customer-webapp/**" - ".github/workflows/CustomerWebpage-Deploy-WF.yml" @@ -45,7 +51,7 @@ jobs: VITE_SIMULATOR_API_BASE: ${{ vars.VITE_SIMULATOR_API_BASE }} - name: Azure Login - if: github.ref == 'refs/heads/main' + if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' uses: azure/login@v2 with: client-id: ${{ secrets.AZURE_CLIENT_ID }} @@ -53,7 +59,7 @@ jobs: subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Deploy to Azure Web App - if: github.ref == 'refs/heads/main' + if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' uses: azure/webapps-deploy@v3 with: app-name: WA-DeliveryBot-dev