Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -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://<owner>.github.io/<repo>/
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
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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: <https://powershellyoungteam.github.io/RoadRouteCardMaker/>** (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
Expand Down Expand Up @@ -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 <https://powershellyoungteam.github.io/RoadRouteCardMaker/>. 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
Expand Down
7 changes: 7 additions & 0 deletions Workfolder/web-app-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ npm test
npm run build
```

The hosted copy at <https://powershellyoungteam.github.io/RoadRouteCardMaker/> 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.
Expand Down
Loading