Skip to content

Commit

Permalink
Separate frontend and backend Sentry projects
Browse files Browse the repository at this point in the history
  • Loading branch information
valtterikantanen committed Jul 30, 2024
1 parent 24579c2 commit 067e837
Showing 1 changed file with 39 additions and 9 deletions.
48 changes: 39 additions & 9 deletions .github/workflows/production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ jobs:
username: toska+github
password: ${{ secrets.QUAY_IO_TOKEN }}

sentry_release:
name: 'Create Sentry release'
sentry_release_frontend:
name: 'Create Sentry release for frontend'
runs-on: ubuntu-latest
needs:
- release_frontend
Expand All @@ -94,12 +94,40 @@ jobs:
- name: Pull frontend image and create a container
run: docker create --name frontend quay.io/toska/oodikone-frontend:production

- name: Pull backend image and create a container
run: docker create --name backend quay.io/toska/oodikone-backend:production

- name: Copy assets from the frontend container
run: docker cp frontend:/opt/app-root/src/build ./build

- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_URL: https://toska.cs.helsinki.fi/
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_TOKEN }}
SENTRY_ORG: toska
SENTRY_PROJECT: oodikone
with:
environment: production
set_commits: 'skip'
sourcemaps: './build/assets'
url_prefix: '~/assets'
version: ${{ steps.extract_version.outputs.VERSION }}

sentry_release_backend:
name: 'Create Sentry release for backend'
runs-on: ubuntu-latest
needs:
- release_frontend
- release_backend

steps:
- uses: actions/checkout@v4

- name: Extract release version
id: extract_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Pull backend image and create a container
run: docker create --name backend quay.io/toska/oodikone-backend:production

- name: Copy assets from the backend container
run: docker cp backend:/opt/app-root/src/dist ./dist

Expand All @@ -113,8 +141,8 @@ jobs:
with:
environment: production
set_commits: 'skip'
sourcemaps: './build/assets ./dist'
url_prefix: '~/assets'
sourcemaps: './dist'
url_prefix: '~/dist'
version: ${{ steps.extract_version.outputs.VERSION }}

report_success:
Expand All @@ -123,7 +151,8 @@ jobs:
needs:
- release_frontend
- release_backend
- sentry_release
- sentry_release_frontend
- sentry_release_backend

if: success()

Expand All @@ -143,7 +172,8 @@ jobs:
needs:
- release_frontend
- release_backend
- sentry_release
- sentry_release_frontend
- sentry_release_backend

if: failure()

Expand Down

0 comments on commit 067e837

Please sign in to comment.