Skip to content

Commit

Permalink
Merge pull request #325 from n0th1ng-else/sentry-release
Browse files Browse the repository at this point in the history
  • Loading branch information
n0th1ng-else authored Jun 17, 2023
2 parents d22395d + d82da6d commit 782a701
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/ci-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ jobs:
uses: ./.github/workflows/scan.yml
secrets: inherit

deploy:
prerelease:
needs: [scan]
uses: ./.github/workflows/deploy.yml
uses: ./.github/workflows/prerelease.yml
secrets: inherit

postrelease:
needs: [deploy]
uses: ./.github/workflows/postrelease.yml
deploy:
needs: [prerelease]
uses: ./.github/workflows/deploy.yml
secrets: inherit
with:
version: ${{ needs.prerelease.outputs.version }}
9 changes: 7 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: App Deploy

on:
workflow_call:
inputs:
version:
type: string
description: "Version tag"
required: true

jobs:
docker:
Expand Down Expand Up @@ -32,7 +37,7 @@ jobs:
tags: |
ghcr.io/${{ secrets.DOCKER_USERNAME }}/voice-to-text-bot/voice-to-speech-app:latest
ghcr.io/${{ secrets.DOCKER_USERNAME }}/voice-to-text-bot/voice-to-speech-app:${{ github.sha }}
build-args: APP_VERSION=${{ github.sha }}
build-args: APP_VERSION=${{ github.event.inputs.version }}

heroku:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -63,7 +68,7 @@ jobs:
run: heroku container:push web --app ${{ vars.HEROKU_APP }} --arg APP_VERSION=${{ env.D_VERSION }}
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
D_VERSION: ${{ github.sha }}
D_VERSION: ${{ github.event.inputs.message }}

- name: Release docker image
run: heroku container:release web --app ${{ vars.HEROKU_APP }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: Post-release
name: Pre-release

on:
workflow_call:
outputs:
version:
description: "Export version tag"
value: ${{ jobs.tag-release.outputs.version }}

jobs:
tag-release:
Expand Down
3 changes: 2 additions & 1 deletion src/monitoring/sentry.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Express } from "express";
import * as sentry from "@sentry/node";
import { ProfilingIntegration } from "@sentry/profiling-node";
import { nodeEnvironment, sentryDsn } from "../env.js";
import { appVersion, nodeEnvironment, sentryDsn } from "../env.js";
import { isDevelopment } from "../common/environment.js";

const isEnabled = (): boolean => {
Expand All @@ -15,6 +15,7 @@ export const initSentry = (app: Express): void => {
sentry.init({
dsn: sentryDsn,
environment: nodeEnvironment,
release: appVersion,
integrations: [
// enable HTTP calls tracing
new sentry.Integrations.Http({ tracing: true }),
Expand Down

0 comments on commit 782a701

Please sign in to comment.