This guide provides operational procedures for deploying, monitoring, and troubleshooting the WUI (frontend).
| Environment | URL |
|---|---|
| inf | https://inf.carpulsetracker.com |
| dev | https://dev.carpulsetracker.com |
| tst | https://tst.carpulsetracker.com |
| prd | https://carpulsetracker.com |
Pushing to the master branch automatically deploys to inf and dev environments.
git push origin master
For tst and prd environments, use the GitHub Actions UI or CLI:
Via GitHub UI: 1. Go to https://github.com/csitea/bnc-cpt-wui/actions 2. Click on "ci-cd: wui-build-deploy" 3. Click "Run workflow" 4. Select the target environment (inf/dev/tst/prd) 5. Click "Run workflow"
Via GitHub CLI:
# Deploy to a specific environment
gh workflow run ci.yaml -f environment=dev --repo csitea/bnc-cpt-wui
# Deploy to all environments
for env in inf dev tst prd; do
echo "=== Deploying to $env ==="
gh workflow run ci.yaml -f environment=$env --repo csitea/bnc-cpt-wui
sleep 30
done
cd /opt/bnc/bnc-cpt/bnc-cpt-utl
# Deploy to single environment
ENV=dev ./run -a do_gcp_deploy_wui
# Deploy to all environments
for env in inf dev tst prd; do
ENV=$env ./run -a do_gcp_deploy_wui
done
# List recent workflow runs
gh run list --workflow=ci.yaml --repo csitea/bnc-cpt-wui
# Watch the latest run in real-time
gh run watch --repo csitea/bnc-cpt-wui
# View logs of latest run
gh run view --log --repo csitea/bnc-cpt-wui
# View logs of failed run
gh run view --log-failed --repo csitea/bnc-cpt-wui
# Quick check all environments
for env in inf dev tst prd; do
if [ "$env" = "prd" ]; then
url="https://carpulsetracker.com"
else
url="https://$env.carpulsetracker.com"
fi
echo -n "$env: "
curl -s -o /dev/null -w "%{http_code}" "$url/index.html"
echo ""
done
Check the deployed version by viewing the HTML source:
for env in inf dev tst; do
echo -n "$env: "
curl -s "https://$env.carpulsetracker.com/index.html" | grep -o 'content="v[^"]*"' | head -1
done
echo -n "prd: "
curl -s "https://carpulsetracker.com/index.html" | grep -o 'content="v[^"]*"' | head -1
Or in a browser: right-click > View Page Source > search for <meta name="version".
cd /opt/bnc/bnc-cpt/bnc-cpt-utl
# Bump patch version (v1.0.1 -> v1.0.2)
./run -a do_version_bump
# Bump minor version (v1.0.9 -> v1.1.0)
BUMP=minor ./run -a do_version_bump
# Push the new tag
git -C /opt/bnc/bnc-cpt/bnc-cpt-wui push origin <new-tag>
The version is injected into the HTML at build time and becomes visible on the next deployment.
If users report seeing stale content after deployment:
# Single environment
ENV=dev
gcloud auth activate-service-account --key-file=$HOME/.gcp/.bnc/key-bnc-cpt-$ENV.json
gcloud compute url-maps invalidate-cdn-cache bnc-cpt-${ENV}-wui-https-url-map \
--path="/*" --project=bnc-cpt-$ENV
# All environments
for env in inf dev tst prd; do
gcloud auth activate-service-account --key-file=$HOME/.gcp/.bnc/key-bnc-cpt-${env}.json 2>/dev/null
gcloud compute url-maps invalidate-cdn-cache bnc-cpt-${env}-wui-https-url-map \
--path="/*" --project=bnc-cpt-${env}
done
ENV=dev
gcloud auth activate-service-account --key-file=$HOME/.gcp/.bnc/key-bnc-cpt-$ENV.json
gsutil ls gs://bnc-cpt-${ENV}-site-static/
gsutil du -sh gs://bnc-cpt-${ENV}-site-static/
index.html version: curl -s https://dev.carpulsetracker.com/index.html | grep versiongsutil ls gs://bnc-cpt-dev-site-static/gh run view --log-failed --repo csitea/bnc-cpt-wuiGCP_SA_KEY_* secrets are set correctlyIf the frontend loads but API calls fail with CORS errors:
1. Check the API's CORS configuration matches the WUI domain
2. Verify the correct VITE_API_BASE_URL was used during build
bnc-cpt-api/doc/md/bnc-cpt-api.OPS.mdbnc-cpt-utl/doc/md/bnc-cpt-inf.OPS.mdbnc-cpt-wui/doc/md/bnc-cpt-wui.SYG.md