diff --git a/.github/workflows/production.yaml b/.github/workflows/production.yaml index 104ed924de..3f8837b360 100644 --- a/.github/workflows/production.yaml +++ b/.github/workflows/production.yaml @@ -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 @@ -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 @@ -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: @@ -123,7 +151,8 @@ jobs: needs: - release_frontend - release_backend - - sentry_release + - sentry_release_frontend + - sentry_release_backend if: success() @@ -143,7 +172,8 @@ jobs: needs: - release_frontend - release_backend - - sentry_release + - sentry_release_frontend + - sentry_release_backend if: failure()