feat: integrate sentry.io for advanced error tracings and stacks #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Upload Source Maps | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "16" # Specify your Node.js version | |
- name: Install dependencies | |
run: npm install | |
- name: Build project | |
run: npm run build | |
- name: Install Sentry CLI | |
run: npm install -g @sentry/cli | |
- name: Inject id | |
run: sentry-cli sourcemaps inject dist | |
- name: Upload source maps to Sentry | |
env: | |
SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | |
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_URL: https://sentry.io/ # Change if you're using a self-hosted Sentry instance | |
run: | | |
sentry-cli sourcemaps upload ./dist -o $SENTRY_ORG -p $SENTRY_PROJECT |