From 1f55e8e913ad98a8910b33c03f531bd3a0c5f037 Mon Sep 17 00:00:00 2001 From: Nigel Breslaw Date: Wed, 7 Feb 2024 17:09:20 +0100 Subject: [PATCH] Deploy Expo web instead of vanilla React (#318) * Possible expo-web build? * Try to deploy --- .github/workflows/deploy-gg-web.yml | 10 ++++---- native_gg/App.tsx | 6 +++-- native_gg/app.json | 2 ++ .../.well-known/apple-app-site-association | 23 +++++++++++++++++++ native_gg/public/.well-known/assetlinks.json | 13 +++++++++++ 5 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 native_gg/public/.well-known/apple-app-site-association create mode 100644 native_gg/public/.well-known/assetlinks.json diff --git a/.github/workflows/deploy-gg-web.yml b/.github/workflows/deploy-gg-web.yml index 75bf04058..dda89a046 100644 --- a/.github/workflows/deploy-gg-web.yml +++ b/.github/workflows/deploy-gg-web.yml @@ -1,7 +1,7 @@ on: push: paths: - - 'gg-mono/apps/react-frontend/**' + - 'native_gg/**' jobs: deploy: runs-on: ubuntu-latest @@ -10,7 +10,7 @@ jobs: TURBO_CODE: ${{ secrets.TURBO_CODE }} defaults: run: - working-directory: gg-mono + working-directory: native_gg permissions: contents: read deployments: write @@ -23,12 +23,12 @@ jobs: - name: install dependencies run: pnpm install --frozen-lockfile - name: build - run: cd apps/react-frontend && pnpm build:ci - - name: deploy dashboard + run: pnpm expo export -p web + - name: deploy website uses: cloudflare/pages-action@v1.5.0 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} projectName: gg-app - directory: gg-mono/apps/react-frontend/dist # e.g. 'dist' + directory: native_gg/dist gitHubToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/native_gg/App.tsx b/native_gg/App.tsx index d83ec2472..c795d9304 100644 --- a/native_gg/App.tsx +++ b/native_gg/App.tsx @@ -26,8 +26,10 @@ export default function App() { }, [url]); function openURL(url: string) { - console.log("Opening URL in WebBrowser"); - WebBrowser.openAuthSessionAsync(url, null); + console.log("Opening URL in WebBrowser!"); + WebBrowser.openAuthSessionAsync(url, "https://guardianghost.com/auth").then((result) => { + console.log("WebBrowser result", result); + }); } return ( diff --git a/native_gg/app.json b/native_gg/app.json index 78eef8b3a..08155de28 100644 --- a/native_gg/app.json +++ b/native_gg/app.json @@ -36,6 +36,8 @@ ] }, "web": { + "output": "single", + "bundler": "metro", "favicon": "./assets/favicon.png" }, "plugins": [ diff --git a/native_gg/public/.well-known/apple-app-site-association b/native_gg/public/.well-known/apple-app-site-association new file mode 100644 index 000000000..343c81a63 --- /dev/null +++ b/native_gg/public/.well-known/apple-app-site-association @@ -0,0 +1,23 @@ +{ + "applinks": { + "details": [ + { + "appIDs": ["X2Z8M625Y9.com.guardianghost.mobile"], + "components": [ + { + "#": "no_universal_links", + "exclude": true, + "comment": "Matches any URL with a fragment that equals no_universal_links and instructs the system not to open it as a universal link." + }, + { + "/": "/auth", + "comment": "Matches a URL with a path that starts with /auth." + } + ] + } + ] + }, + "webcredentials": { + "apps": ["X2Z8M625Y9.com.guardianghost.mobile"] + } +} diff --git a/native_gg/public/.well-known/assetlinks.json b/native_gg/public/.well-known/assetlinks.json new file mode 100644 index 000000000..b3bcac61d --- /dev/null +++ b/native_gg/public/.well-known/assetlinks.json @@ -0,0 +1,13 @@ +[ + { + "relation": ["delegate_permission/common.handle_all_urls"], + "target": { + "namespace": "android_app", + "package_name": "com.guardianghost", + "sha256_cert_fingerprints": [ + "03:8C:FF:63:6D:B2:BB:00:0D:37:4D:AF:D3:37:CC:CA:48:9B:BF:33:0B:EB:91:86:20:79:80:16:AE:E9:B2:FB", + "FA:C6:17:45:DC:09:03:78:6F:B9:ED:E6:2A:96:2B:39:9F:73:48:F0:BB:6F:89:9B:83:32:66:75:91:03:3B:9C" + ] + } + } +]