You've already forked AstralRinth
forked from didirus/AstralRinth
deploy: add sentry to frontend server (#5118)
* deploy: add sentry to frontend server * build: add sentry auth token to env * fix: use sentry CLI for sourcemap upload instead * feat: comment deploy --------- Co-authored-by: Calum H. (IMB11) <contact@cal.engineer>
This commit is contained in:
28
.github/workflows/frontend-deploy.yml
vendored
28
.github/workflows/frontend-deploy.yml
vendored
@@ -23,11 +23,12 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
deployments: write
|
deployments: write
|
||||||
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 2
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Configure environment
|
- name: Configure environment
|
||||||
id: meta
|
id: meta
|
||||||
@@ -76,6 +77,18 @@ jobs:
|
|||||||
CF_PAGES_BRANCH: ${{ github.ref_name }}
|
CF_PAGES_BRANCH: ${{ github.ref_name }}
|
||||||
CF_PAGES_COMMIT_SHA: ${{ github.sha }}
|
CF_PAGES_COMMIT_SHA: ${{ github.sha }}
|
||||||
CF_PAGES_URL: ${{ steps.meta.outputs.url }}
|
CF_PAGES_URL: ${{ steps.meta.outputs.url }}
|
||||||
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||||
|
|
||||||
|
- name: Create Sentry release and upload sourcemaps
|
||||||
|
uses: getsentry/action-release@v3
|
||||||
|
env:
|
||||||
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||||
|
SENTRY_ORG: modrinth
|
||||||
|
SENTRY_PROJECT: knossos-server
|
||||||
|
with:
|
||||||
|
environment: ${{ steps.meta.outputs.env || 'production' }}
|
||||||
|
sourcemaps: ./apps/frontend/.output/server
|
||||||
|
url_prefix: '~/'
|
||||||
|
|
||||||
- name: Deploy Cloudflare Worker
|
- name: Deploy Cloudflare Worker
|
||||||
id: wrangler
|
id: wrangler
|
||||||
@@ -97,3 +110,16 @@ jobs:
|
|||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
--data '{"hosts": ["modrinth.com", "www.modrinth.com", "staging.modrinth.com"]}' \
|
--data '{"hosts": ["modrinth.com", "www.modrinth.com", "staging.modrinth.com"]}' \
|
||||||
https://api.cloudflare.com/client/v4/zones/e39df17b9c4ef44cbce2646346ee6d33/purge_cache
|
https://api.cloudflare.com/client/v4/zones/e39df17b9c4ef44cbce2646346ee6d33/purge_cache
|
||||||
|
|
||||||
|
- name: Comment deploy URL on PR
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
|
uses: peter-evans/create-or-update-comment@v4
|
||||||
|
with:
|
||||||
|
issue-number: ${{ github.event.pull_request.number }}
|
||||||
|
body: |
|
||||||
|
## 🚀 Frontend Deploy
|
||||||
|
|
||||||
|
| Commit | URL |
|
||||||
|
|--------|-----|
|
||||||
|
| ${{ github.event.pull_request.head.sha }} | ${{ steps.wrangler.outputs.deployment-url }} |
|
||||||
|
comment-tag: frontend-deploy
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ export default defineNuxtConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
modules: ['@nuxtjs/i18n', '@pinia/nuxt', 'floating-vue/nuxt'],
|
modules: ['@nuxtjs/i18n', '@pinia/nuxt', 'floating-vue/nuxt', '@sentry/nuxt/module'],
|
||||||
floatingVue: {
|
floatingVue: {
|
||||||
themes: {
|
themes: {
|
||||||
'ribbit-popout': {
|
'ribbit-popout': {
|
||||||
@@ -266,6 +266,9 @@ export default defineNuxtConfig({
|
|||||||
cloudflare: {
|
cloudflare: {
|
||||||
nodeCompat: true,
|
nodeCompat: true,
|
||||||
},
|
},
|
||||||
|
replace: {
|
||||||
|
__SENTRY_RELEASE__: JSON.stringify(process.env.CF_PAGES_COMMIT_SHA || 'unknown'),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
devtools: {
|
devtools: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
@@ -313,6 +316,12 @@ export default defineNuxtConfig({
|
|||||||
experimental: {
|
experimental: {
|
||||||
asyncContext: isProduction(),
|
asyncContext: isProduction(),
|
||||||
},
|
},
|
||||||
|
sourcemap: { client: 'hidden' },
|
||||||
|
sentry: {
|
||||||
|
sourcemaps: {
|
||||||
|
disable: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
function getApiUrl() {
|
function getApiUrl() {
|
||||||
|
|||||||
@@ -48,12 +48,14 @@
|
|||||||
"@modrinth/ui": "workspace:*",
|
"@modrinth/ui": "workspace:*",
|
||||||
"@modrinth/utils": "workspace:*",
|
"@modrinth/utils": "workspace:*",
|
||||||
"@pinia/nuxt": "^0.11.3",
|
"@pinia/nuxt": "^0.11.3",
|
||||||
|
"@sentry/nuxt": "^10.33.0",
|
||||||
"@tanstack/vue-query": "^5.90.7",
|
"@tanstack/vue-query": "^5.90.7",
|
||||||
"@types/three": "^0.172.0",
|
"@types/three": "^0.172.0",
|
||||||
"@vitejs/plugin-vue": "^6.0.3",
|
"@vitejs/plugin-vue": "^6.0.3",
|
||||||
"@vue-email/components": "^0.0.21",
|
"@vue-email/components": "^0.0.21",
|
||||||
"@vue-email/render": "^0.0.9",
|
"@vue-email/render": "^0.0.9",
|
||||||
"@vueuse/core": "^11.1.0",
|
"@vueuse/core": "^11.1.0",
|
||||||
|
"ace-builds": "^1.36.2",
|
||||||
"ansi-to-html": "^0.7.2",
|
"ansi-to-html": "^0.7.2",
|
||||||
"dayjs": "^1.11.7",
|
"dayjs": "^1.11.7",
|
||||||
"dompurify": "^3.1.7",
|
"dompurify": "^3.1.7",
|
||||||
@@ -65,7 +67,6 @@
|
|||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"jszip": "^3.10.1",
|
"jszip": "^3.10.1",
|
||||||
"markdown-it": "14.1.0",
|
"markdown-it": "14.1.0",
|
||||||
"ace-builds": "^1.36.2",
|
|
||||||
"pathe": "^1.1.2",
|
"pathe": "^1.1.2",
|
||||||
"pinia": "^3.0.0",
|
"pinia": "^3.0.0",
|
||||||
"pinia-plugin-persistedstate": "^4.4.1",
|
"pinia-plugin-persistedstate": "^4.4.1",
|
||||||
|
|||||||
11
apps/frontend/src/server/plugins/sentry-cloudflare-plugin.ts
Normal file
11
apps/frontend/src/server/plugins/sentry-cloudflare-plugin.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { sentryCloudflareNitroPlugin } from '@sentry/nuxt/module/plugins'
|
||||||
|
|
||||||
|
declare const __SENTRY_RELEASE__: string
|
||||||
|
|
||||||
|
export default defineNitroPlugin(
|
||||||
|
sentryCloudflareNitroPlugin({
|
||||||
|
dsn: 'https://9cf8f56ab7055ab6b1042fad535f2a44@o485889.ingest.us.sentry.io/4510709722185728',
|
||||||
|
tracesSampleRate: 1.0,
|
||||||
|
release: __SENTRY_RELEASE__,
|
||||||
|
}),
|
||||||
|
)
|
||||||
@@ -26,6 +26,9 @@
|
|||||||
"secret_name": "labrinth-production-ratelimit-key"
|
"secret_name": "labrinth-production-ratelimit-key"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"version_metadata": {
|
||||||
|
"binding": "CF_VERSION_METADATA"
|
||||||
|
},
|
||||||
"vars": {
|
"vars": {
|
||||||
"ENVIRONMENT": "production",
|
"ENVIRONMENT": "production",
|
||||||
"BASE_URL": "https://api.modrinth.com/v2/",
|
"BASE_URL": "https://api.modrinth.com/v2/",
|
||||||
|
|||||||
1017
pnpm-lock.yaml
generated
1017
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user