Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sentry issue tracking #50

Merged
merged 14 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 48 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# This workflow publishes the Docker image to the GitHub Container Registry and the Helm chart to the appropriate s3 bucket.
# It's triggered when a new tag is pushed to the repository, this can either be in main (as a release tag) or in a feature
# It's triggered when a new tag is pushed to the repository, this can either be in main (as a release tag) or in a feature
# branch (as a prerelease tag).

name: Publish

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
- 'v[0-9]+.[0-9]+.[0-9]+*'

# Note this alone is not enough to give the action write access
# In the registry settings https://github.com/users/danielemery/packages/container/quizlord-api/settings
Expand Down Expand Up @@ -60,8 +60,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Extract version from github ref
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: nowsprinting/check-version-format-action@v3
id: version
with:
prefix: 'v'

- name: Download build artifacts
uses: actions/download-artifact@v3
Expand All @@ -80,6 +82,8 @@ jobs:
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=${{ steps.version.outputs.is_stable == 'true' && 'true' || 'false' }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
Expand All @@ -89,17 +93,19 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
IMAGE_VERSION=${{ env.RELEASE_VERSION }}
IMAGE_VERSION=${{ steps.version.outputs.full }}

helm-publish:
needs:
- build
# - docker-publish
- docker-publish
runs-on: ubuntu-latest

steps:
- name: Extract version from github ref
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: nowsprinting/check-version-format-action@v3
id: version
with:
prefix: 'v'

- name: Download chart definition
uses: actions/download-artifact@v3
Expand All @@ -119,5 +125,37 @@ jobs:
with:
repo: s3://helm.demery.net/
chart: ./helm
version: ${{ env.RELEASE_VERSION }}
appVersion: ${{ env.RELEASE_VERSION }}
version: ${{ steps.version.outputs.full }}
appVersion: ${{ steps.version.outputs.full }}

sentry-sourcemaps-publish:
needs:
- build
- docker-publish
runs-on: ubuntu-latest

steps:
- uses: nowsprinting/check-version-format-action@v3
id: version
with:
prefix: 'v'

- name: Checkout
uses: actions/checkout@v4

- name: Download build artifacts with sourcemaps
uses: actions/download-artifact@v3
with:
name: build-artifacts

- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT }}
with:
environment: ${{ steps.version.outputs.is_stable == 'true' && 'prod' || 'stg' }}
sourcemaps: ./dist
version: ${{ steps.version.outputs.full }}
url_prefix: '/app'
Loading