fix(sentry): decrease sample rate to 50% (#1313) #1120
This file contains hidden or 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: Build & Deploy | |
| on: | |
| push: | |
| branches: [main, platform] | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository_owner }}/stardance-production | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| outputs: | |
| image: ${{ steps.meta.outputs.tags }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| token: ${{ secrets.SUBMODULES_TOKEN || github.token }} | |
| - name: Verify secrets submodule | |
| run: test -f secrets/app/models/secrets/vote_auto_discarder.rb | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4.2.0 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v4.6.0 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata (tags, labels) | |
| id: meta | |
| uses: docker/metadata-action@v6.2.0 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} | |
| type=raw,value=platform,enable=${{ github.ref == 'refs/heads/platform' }} | |
| type=sha,prefix=sha-,format=short | |
| - name: Build and push | |
| uses: docker/build-push-action@v7.3.0 | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: | | |
| GIT_COMMIT_SHA=${{ github.sha }} | |
| cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:cache | |
| cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:cache,mode=max | |
| deploy: | |
| needs: build-and-push | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Trigger Coolify redeploy | |
| env: | |
| WEBHOOK_MAIN: ${{ secrets.COOLIFY_WEBHOOK }} | |
| WEBHOOK_PLATFORM: ${{ secrets.COOLIFY_WEBHOOK_PLATFORM }} | |
| COOLIFY_TOKEN: ${{ secrets.COOLIFY_TOKEN }} | |
| run: | | |
| if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then | |
| WEBHOOK="$WEBHOOK_MAIN" | |
| else | |
| WEBHOOK="$WEBHOOK_PLATFORM" | |
| fi | |
| curl --fail-with-body --silent --show-error \ | |
| -X POST "$WEBHOOK" \ | |
| -H "Authorization: Bearer $COOLIFY_TOKEN" |