From edd2dc72f8e7e81d3a7bab736a1f9a35701f2c6d Mon Sep 17 00:00:00 2001 From: Wighty <53131013+PowerShellYoungTeam@users.noreply.github.com> Date: Tue, 6 Oct 2026 01:24:35 +0100 Subject: [PATCH] Deploy the web app to GitHub Pages Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .github/workflows/pages.yml | 58 ++++++++++++++++++++++++++++++ README.md | 10 +++++- Workfolder/web-app-react/README.md | 7 ++++ 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pages.yml diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..9524394 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,58 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: [main] + paths: + - 'Workfolder/web-app-react/**' + - 'Workfolder/schema/**' + - '.github/workflows/pages.yml' + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + defaults: + run: + working-directory: Workfolder/web-app-react + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version: 22 + cache: npm + cache-dependency-path: Workfolder/web-app-react/package-lock.json + - run: npm ci + - name: Test + run: npm test -- --watchAll=false + env: + CI: true + - name: Build + run: npm run build + env: + CI: true + # Served from https://.github.io// + PUBLIC_URL: /${{ github.event.repository.name }} + - uses: actions/configure-pages@v6 + - uses: actions/upload-pages-artifact@v5 + with: + path: Workfolder/web-app-react/build + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@v5 diff --git a/README.md b/README.md index 3a781ab..a969f55 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # RoadRouteCardMaker [![CI](https://github.com/PowerShellYoungTeam/RoadRouteCardMaker/actions/workflows/ci.yml/badge.svg)](https://github.com/PowerShellYoungTeam/RoadRouteCardMaker/actions/workflows/ci.yml) +[![Deploy](https://github.com/PowerShellYoungTeam/RoadRouteCardMaker/actions/workflows/pages.yml/badge.svg)](https://github.com/PowerShellYoungTeam/RoadRouteCardMaker/actions/workflows/pages.yml) + +**Try it online: ** (no install; use fictional or non-sensitive routes only). Plan a road move on OpenStreetMap and produce a military-style **route card**: the INSTRUCTIONS block (items 1-16, short-form field book wording) plus the ROUTE DETAILS table. It is built with big and heavy vehicles in mind @@ -40,7 +43,12 @@ Ser | From | To | Route | Dir | Distance | Total Distance | Total Time ## Quick start -**Web app** (requires Node.js 18 or later): +**Hosted web app:** open . It is rebuilt and redeployed by GitHub Actions +([`pages.yml`](.github/workflows/pages.yml)) whenever the app changes on `main`, and runs entirely in +your browser. Cards are not stored on any server, but route planning, place search and the restriction +check still call the public OpenStreetMap services. + +**Run locally** (requires Node.js 18 or later): ```powershell cd Workfolder\web-app-react diff --git a/Workfolder/web-app-react/README.md b/Workfolder/web-app-react/README.md index 2936222..29dfaa6 100644 --- a/Workfolder/web-app-react/README.md +++ b/Workfolder/web-app-react/README.md @@ -29,6 +29,13 @@ npm test npm run build ``` +The hosted copy at is built and deployed by +[`.github/workflows/pages.yml`](../../.github/workflows/pages.yml) on every push to `main` that touches +the app. It sets `PUBLIC_URL=/RoadRouteCardMaker` so assets load from the repository sub-path; set the +same variable if you host the build under another sub-path. The `build` folder is a static site, so you +can also copy it to any web server or open it from a local static server for offline use (routing and +restriction checks still need network access to their servers). + ## Workflow 1. Click the map, or use the search box, to add waypoints. Drag the markers to adjust them.