blob: daf3b6bfaefe4e31694f6c572b293946a603c6de (
plain) (
blame)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
 | name: Create Sentry release
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
jobs:
  build:
    runs-on: ubuntu-latest
    if: ${{ github.actor != 'dependabot[bot]' }}
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
      - name: Install dependencies
        run: yarn install --prod
      - name: Set SHA
        id: commit-sha
        run: |
          if ${{ github.ref == 'refs/heads/main' }};
            then echo "::set-output name=sha::${{ github.sha }}";
            else echo "::set-output name=sha::${{ github.event.pull_request.head.sha }}";
          fi;
      - name: Build application
        run: yarn build
        env:
          REACT_APP_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
          COMMIT_REF: ${{ steps.commit-sha.outputs.sha }}
          REACT_APP_OAUTH2_CLIENT_ID: ${{ secrets.CLIENT_ID }}
      - name: Create Sentry release (production)
        if: github.ref == 'refs/heads/main'
        uses: getsentry/action-release@v1
        env:
          SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
          SENTRY_ORG: python-discord
          SENTRY_PROJECT: forms-frontend
        with:
          environment: production
          sourcemaps: './build'
          version_prefix: forms-frontend@
      - name: Create Sentry release (deploy preview)
        if: github.ref != 'refs/heads/main'
        uses: getsentry/action-release@v1
        env:
          SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
          SENTRY_ORG: python-discord
          SENTRY_PROJECT: forms-frontend
        with:
          environment: deploy-preview
          sourcemaps: './build'
          version_prefix: forms-frontend@
 |