|
| 1 | +# Eurosky fork: build the web app and deploy it to the DEV Bunny.net zone. |
| 2 | +# |
| 3 | +# Dev mirror of deploy-web-staging-bunny.yml, served at https://dev.mu.social. |
| 4 | +# Unlike staging (which continuously tracks eurosky/fork), dev is manual-only: |
| 5 | +# run the workflow from the Actions tab and pick any branch to put it live. |
| 6 | +# Useful for trying out risky or experimental branches without disturbing |
| 7 | +# staging. New file (not in upstream) -> no merge surface. |
| 8 | +# |
| 9 | +# Dev differs from staging only in build-time env (see the Build step): its |
| 10 | +# own OAuth client identity (assertions come from the shared non-prod worker |
| 11 | +# at oauth-staging.mu.social - see services/oauth/bunny/staging.ts), and its |
| 12 | +# own throwaway Plausible domain. Search noindexing is handled at the Bunny |
| 13 | +# pull zone (Edge Rule adds X-Robots-Tag: noindex, nofollow), not in the |
| 14 | +# build. |
| 15 | +# |
| 16 | +# Required repo secrets (Settings -> Secrets and variables -> Actions): |
| 17 | +# DEV_BUNNY_STORAGE_ZONE full base URL incl. zone, e.g. |
| 18 | +# https://storage.bunnycdn.com/mu-dev |
| 19 | +# DEV_BUNNY_STORAGE_PASSWORD storage zone password (AccessKey for uploads) |
| 20 | +# DEV_BUNNY_PULLZONE_ID numeric dev pull zone id (cache purge) |
| 21 | +# BUNNY_API_KEY account-level API key (shared with prod) |
| 22 | +name: Deploy web dev (Bunny) |
| 23 | + |
| 24 | +on: |
| 25 | + # Manual only: Actions tab -> "Deploy web dev (Bunny)" -> Run workflow -> |
| 26 | + # pick the branch to deploy. No push trigger; dev is an on-demand target. |
| 27 | + workflow_dispatch: {} |
| 28 | + |
| 29 | +# Never run two dev deploys at once; a newer run supersedes an in-flight one. |
| 30 | +# Separate group from prod/staging so the three never queue on each other. |
| 31 | +concurrency: |
| 32 | + group: deploy-web-dev-bunny |
| 33 | + cancel-in-progress: true |
| 34 | + |
| 35 | +# Least privilege: only checks out + uploads to Bunny via Bunny secrets; never |
| 36 | +# uses GITHUB_TOKEN to write to the repo. |
| 37 | +permissions: |
| 38 | + contents: read |
| 39 | + |
| 40 | +jobs: |
| 41 | + deploy: |
| 42 | + runs-on: ubuntu-latest |
| 43 | + steps: |
| 44 | + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| 45 | + - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 |
| 46 | + - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 |
| 47 | + with: |
| 48 | + node-version-file: package.json |
| 49 | + cache: pnpm |
| 50 | + # bunny_build.sh does: frozen install (CI) -> intl:build -> build-web -> |
| 51 | + # static-path rewrite -> _redirects. CI=true is set by Actions, so it |
| 52 | + # uses --frozen-lockfile. |
| 53 | + - name: Build web |
| 54 | + run: bash ./scripts/bunny_build.sh |
| 55 | + env: |
| 56 | + # Dev is its own atproto OAuth client: client_id derives from this |
| 57 | + # base URL (gen-oauth-metadata.js emits the metadata into the build, |
| 58 | + # so dev self-publishes it at /oauth-client-metadata.json). |
| 59 | + # Client assertions come from the shared non-prod worker |
| 60 | + # (services/oauth/bunny/staging.ts): one instance serves EVERY |
| 61 | + # *.mu.social environment by deriving the client_id from the request |
| 62 | + # Origin - adding version N needs no OAuth change at all. Prod stays |
| 63 | + # on its own pinned worker at oauth.mu.social. |
| 64 | + EXPO_PUBLIC_OAUTH_BASE_URL: https://dev.mu.social |
| 65 | + EXPO_PUBLIC_OAUTH_ASSERTION_URL: https://oauth-staging.mu.social/client-assertion |
| 66 | + # Dev routes AUTHED appview traffic to the Eurosky appview: the PDS |
| 67 | + # resolves this DID's #bsky_appview service endpoint |
| 68 | + # (https://api.eurosky.network) and proxies there via the |
| 69 | + # atproto-proxy header. UNAUTHED traffic (logged-out browsing, |
| 70 | + # brand.json services.publicApi/appView) stays on Bluesky's public |
| 71 | + # API for now: the Eurosky appview does not resolve handles yet |
| 72 | + # (handle lookups 404, profiles return handle.invalid), which would |
| 73 | + # break logged-out views. |
| 74 | + EXPO_PUBLIC_BLUESKY_PROXY_DID: did:web:api.eurosky.network |
| 75 | + # Geolocation: same first-party endpoint as prod (services/geolocation/ |
| 76 | + # serves any origin), drives the regional moderation labelers. |
| 77 | + EXPO_PUBLIC_ENABLE_GEOLOCATION: 'true' |
| 78 | + EXPO_PUBLIC_GEOLOCATION_URL: https://ip.mu.social |
| 79 | + EXPO_PUBLIC_ENABLE_LIVE_EVENTS: 'false' |
| 80 | + EXPO_PUBLIC_ENABLE_APP_CONFIG: 'false' |
| 81 | + # Product-analytics events otherwise POST to events.bsky.app. Disabled; |
| 82 | + # GrowthBook flag fetching is unaffected (separate from this client). |
| 83 | + EXPO_PUBLIC_ENABLE_METRICS: 'false' |
| 84 | + # Deliberately NOT the prod Plausible site: dev.mu.social is |
| 85 | + # unregistered in Plausible, so events are accepted and discarded and |
| 86 | + # dev traffic never pollutes prod stats. (Blanking the value is not |
| 87 | + # an option: bunny_build.sh's `:=` re-defaults empty to mu.social.) |
| 88 | + EXPO_PUBLIC_PLAUSIBLE_DOMAIN: dev.mu.social |
| 89 | + # First-party Bunny proxy for Plausible (see services/plausible/). Needs |
| 90 | + # the scheme: the tracker posts to ${API_HOST}/api/event. |
| 91 | + EXPO_PUBLIC_PLAUSIBLE_API_HOST: https://events.mu.social |
| 92 | + # Shares the prod live-sports proxy (see services/footballData/); the |
| 93 | + # endpoint is read-only and cached, so dev can reuse it. |
| 94 | + EXPO_PUBLIC_FOOTBALLDATA_API_URL: https://sports.mu.social/v4 |
| 95 | + - name: Upload to Bunny + purge cache |
| 96 | + run: bash ./scripts/bunny_upload.sh |
| 97 | + env: |
| 98 | + BUNNY_STORAGE_ZONE: ${{ secrets.DEV_BUNNY_STORAGE_ZONE }} |
| 99 | + BUNNY_STORAGE_PASSWORD: ${{ secrets.DEV_BUNNY_STORAGE_PASSWORD }} |
| 100 | + BUNNY_API_KEY: ${{ secrets.BUNNY_API_KEY }} |
| 101 | + BUNNY_PULLZONE_ID: ${{ secrets.DEV_BUNNY_PULLZONE_ID }} |
0 commit comments