Skip to content

Commit 002ab48

Browse files
authored
feat: Use Vercel for previews (#394)
* feat: use env var for api to handle vercel deployment * fix: remove broken firebase actions stages
1 parent 3e0136d commit 002ab48

File tree

2 files changed

+3
-25
lines changed

2 files changed

+3
-25
lines changed

.github/workflows/frontend.yaml

-24
Original file line numberDiff line numberDiff line change
@@ -66,27 +66,3 @@ jobs:
6666
env:
6767
REACT_APP_SENTRY_RELEASE: ${{ github.sha }}
6868
run: npm run build
69-
- name: Share artifact inside workflow
70-
uses: actions/upload-artifact@v2
71-
with:
72-
name: create-react-app-build
73-
path: build
74-
deploy-preview:
75-
name: Deploy to Firebase Hosting Preview
76-
if: '!github.event.pull_request.head.repo.fork'
77-
runs-on: ubuntu-latest
78-
needs: [lint, test, build]
79-
steps:
80-
- uses: actions/checkout@v2
81-
- name: Get artifact
82-
uses: actions/download-artifact@v2
83-
with:
84-
name: create-react-app-build
85-
path: build
86-
- name: Deploy to Firebase Hosting
87-
uses: FirebaseExtended/action-hosting-deploy@v0
88-
with:
89-
repoToken: '${{ secrets.GITHUB_TOKEN }}'
90-
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}'
91-
expires: 7d
92-
projectId: staging-clockwork

src/index.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,14 @@ if (process.env.NODE_ENV === 'production' || process.env.REACT_APP_ANALYTICS) {
6161

6262
const searchClient = algoliasearch('CR92D3S394', '5477854d63b676fe021f8f83f5839a3a');
6363

64+
const baseApiUrl = process.env.REACT_APP_API_URL;
65+
6466
migrateLocalStorage();
6567

6668
ReactDOM.render(
6769
<React.StrictMode>
6870
<Sentry.ErrorBoundary fallback={<>'An error has occurred'</>}>
69-
<RestfulProvider base={'/api'}>
71+
<RestfulProvider base={baseApiUrl ?? '/api'}>
7072
<InstantSearch searchClient={searchClient} indexName="dev_uvic">
7173
<ChakraProvider portalZIndex={999} theme={customTheme}>
7274
<ColorModeScript initialColorMode={customTheme.config.initialColorMode} />

0 commit comments

Comments
 (0)