-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (80 loc) · 3.53 KB
/
deploy-pages.yml
File metadata and controls
91 lines (80 loc) · 3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Builds the Expo web export and publishes to GitHub Pages (static hosting).
#
# Setup (once per repo):
# 1. Settings → Pages → Build and deployment → Source: "GitHub Actions".
# 2. Settings → Secrets and variables → Actions → New repository secret:
# - EXPO_PUBLIC_INFLUX_URL, EXPO_PUBLIC_INFLUX_TOKEN, EXPO_PUBLIC_INFLUX_ORG,
# EXPO_PUBLIC_INFLUX_BUCKET (same values as local .env). The app queries measurement
# sc2-telemetry (see src/constants/influxTelemetry.js); writers must use that name.
# - EXPO_PUBLIC_INFLUX_WEB_PROXY (optional): CORS proxy URL for web; see scripts/influx-web-proxy.worker.example.js.
# - EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY (if the app needs it at build time). Use a production Clerk key for Pages.
# - MAPBOX_ACCESS_TOKEN (optional; also in app.config extra).
# - METEOBLUE_API_KEY (optional; Meteoblue map tiles on Strategy — must be a plain string secret).
# 3. Clerk Dashboard → Native applications → allowlist SSO redirect URLs, e.g.
# https://<owner>.github.io/<repo>/oauth-native-callback
# https://<owner>.github.io/<repo>/ (after sign-out)
# (and dev URLs with the same paths if needed).
# 4. First run may require approving the `github-pages` environment (Deployments).
#
# Project site URL: https://<owner>.github.io/<repo>/
# EXPO_PUBLIC_BASE_PATH below must match that /<repo> prefix so assets load.
#
# Only `main` is allowed to deploy (GitHub Pages environment protection). Merge to main to publish.
# For a site at the domain root (not /repo/), set EXPO_PUBLIC_BASE_PATH in the
# Export step to "" and adjust app.config handling if needed.
name: Deploy web to GitHub Pages
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout (with submodules)
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Use npm 10 for npm ci
run: npm install -g npm@10.9.2
- name: Install dependencies
run: npm ci
- name: Export web (static)
env:
EXPO_PUBLIC_BASE_PATH: /${{ github.event.repository.name }}
EXPO_PUBLIC_INFLUX_URL: ${{ secrets.EXPO_PUBLIC_INFLUX_URL }}
EXPO_PUBLIC_INFLUX_TOKEN: ${{ secrets.EXPO_PUBLIC_INFLUX_TOKEN }}
EXPO_PUBLIC_INFLUX_ORG: ${{ secrets.EXPO_PUBLIC_INFLUX_ORG }}
EXPO_PUBLIC_INFLUX_BUCKET: ${{ secrets.EXPO_PUBLIC_INFLUX_BUCKET }}
EXPO_PUBLIC_INFLUX_WEB_PROXY: ${{ secrets.EXPO_PUBLIC_INFLUX_WEB_PROXY }}
EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY: ${{ secrets.EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY }}
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
# Optional: Meteoblue Maps overlay on Strategy / WeatherMapView (string API key only).
METEOBLUE_API_KEY: ${{ secrets.METEOBLUE_API_KEY }}
run: |
npm run export:web
touch dist/.nojekyll
# SPA fallback: deep links (e.g. OAuth return) are not real files on Pages
cp dist/index.html dist/404.html
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4