Skip to content

Commit

Permalink
fix: ui config (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
vasyl-ivanchuk authored Sep 22, 2023
1 parent 0ca1390 commit a276071
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/app-deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ jobs:
run: |
unzip dist.zip -d packages/app
- name: Update config
run: |
echo "window[\"##runtimeConfig\"] = { sentryDSN: \"${{ vars.SENTRY_DSN }}\" };" > packages/app/dist/config.js
- name: Download Storybook package
uses: dsaltares/fetch-gh-release-asset@master
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: |
VITE_SENTRY_DSN=https://ce75ed993f964591901fbe0b7868aa50@o1242386.ingest.sentry.io/4504802315468800 \
VITE_APP_ENVIRONMENT=production \
npx semantic-release
Expand Down Expand Up @@ -132,7 +131,7 @@ jobs:
- name: Update config
run: |
echo "window[\"##runtimeConfig\"] = { appEnvironment: \"staging\" };" > packages/app/dist/config.js
echo "window[\"##runtimeConfig\"] = { appEnvironment: \"staging\", sentryDSN: \"${{ vars.SENTRY_DSN }}\" };" > packages/app/dist/config.js
- name: Download Storybook package
uses: dsaltares/fetch-gh-release-asset@master
Expand Down
5 changes: 1 addition & 4 deletions packages/app/src/composables/useRuntimeConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ export default (): {

return {
version: import.meta.env?.VITE_VERSION || "localhost",
sentryDSN:
runtimeConfig?.sentryDSN ||
import.meta.env?.VITE_SENTRY_DSN ||
"https://ce75ed993f964591901fbe0b7868aa50@o1242386.ingest.sentry.io/4504802315468800",
sentryDSN: runtimeConfig?.sentryDSN || import.meta.env?.VITE_SENTRY_DSN,
appEnvironment: runtimeConfig?.appEnvironment || import.meta.env?.VITE_APP_ENVIRONMENT || "local",
};
};

0 comments on commit a276071

Please sign in to comment.