Skip to content

Commit

Permalink
add sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
toandq2009 committed Jan 31, 2024
1 parent f05a717 commit d36df54
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 17 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/sentry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This is a basic workflow to help you get started with Actions

name: Sentry

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [sentry-test]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install Yarn
run: npm install -g yarn
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: "**/node_modules"
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --ignore-scripts
- name: Copy env
run: cp .env.example .env
- name: Build Production
run: yarn build
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
REACT_APP_SENTRY_ENVIRONMENT: production
CI: false
34 changes: 17 additions & 17 deletions config-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,26 +85,26 @@ module.exports = {
fs.copyFileSync(vendorFileSrc, vendorFileDest);
}

// if (!isDevelopment && process.env.SENTRY_AUTH_TOKEN) {
// const SentryWebpackPlugin = require('@sentry/webpack-plugin');
// config.devtool = 'source-map';
// config.plugins.push(
// new SentryWebpackPlugin({
// org: 'oraichain',
// project: 'oraidex',
if (!isDevelopment && process.env.SENTRY_AUTH_TOKEN) {
const SentryWebpackPlugin = require('@sentry/webpack-plugin');
config.devtool = 'source-map';
config.plugins.push(
new SentryWebpackPlugin({
org: 'oraichain',
project: 'oraidex',

// // Specify the directory containing build artifacts
// include: './build',
// Specify the directory containing build artifacts
include: './build',

// // Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/
// // and needs the `project:releases` and `org:read` scopes
// authToken: process.env.SENTRY_AUTH_TOKEN,
// Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/
// and needs the `project:releases` and `org:read` scopes
authToken: process.env.SENTRY_AUTH_TOKEN,

// // Optionally uncomment the line below to override automatic release name detection
// release: vendorHash
// })
// );
// }
// Optionally uncomment the line below to override automatic release name detection
release: vendorHash
})
);
}

config.plugins.push(
new webpack.DllReferencePlugin({
Expand Down

0 comments on commit d36df54

Please sign in to comment.