build: sourcemaps from vuejs to sentry #4
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: Sentry Integration | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
env: | |
BRANCH_NAME: ${{ github.ref_name }} | |
permissions: | |
actions: read | |
contents: read | |
jobs: | |
env-job: | |
runs-on: ubuntu-latest | |
outputs: | |
modified-branch-name: ${{ steps.env.outputs.MODIFIED_BRANCH_NAME }} | |
name: test-job | |
steps: | |
- name: Sets MODIFIED_BRANCH_NAME | |
id: env | |
env: | |
name: "${{env.BRANCH_NAME}}" | |
run: | | |
echo "MODIFIED_BRANCH_NAME=${name/\//-}" >> ${GITHUB_OUTPUT} | |
sentry-release: | |
name: Create Sentry release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Create Sentry release | |
uses: getsentry/action-release@v1 | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_ORG: 'betagouv' | |
SENTRY_PROJECT: 'tee-frontend-vue' | |
SENTRY_URL: https://sentry.incubateur.net | |
with: | |
environment: ${{ needs.env-job.outputs.modified-branch-name }} | |
version: ${{ github.ref_name }} | |
build: | |
name: Run build to send sourcemaps to sentry | |
runs-on: ubuntu-latest | |
env: # Or as an environment variable | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
strategy: | |
matrix: | |
node-version: [ '20.x' ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- run: npm clean-install | |
- run: npm run build | |
env: | |
SENTRY_RELEASE_VERSION: ${{ needs.env-job.outputs.modified-branch-name }} |