feat(config): add Sentry Laravel SDK configuration #50
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: Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| inputs: | |
| version_type: | |
| description: 'Version type to bump' | |
| required: true | |
| type: choice | |
| options: | |
| - patch | |
| - minor | |
| - major | |
| jobs: | |
| tests: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.4 | |
| tools: composer:v2 | |
| coverage: xdebug | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| - name: Install Node Dependencies | |
| run: npm ci | |
| - name: Install Dependencies | |
| run: composer install --no-interaction --prefer-dist --optimize-autoloader | |
| - name: Build Assets | |
| run: npm run build | |
| - name: Copy Environment File | |
| run: cp .env.example .env | |
| - name: Generate Application Key | |
| run: php artisan key:generate | |
| - name: Tests | |
| run: ./vendor/bin/pest | |
| lint: | |
| name: Run Linter | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.4' | |
| - name: Install Dependencies | |
| run: | | |
| composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | |
| npm install | |
| - name: Run Pint | |
| run: vendor/bin/pint --test | |
| - name: Run PHPStan | |
| run: vendor/bin/phpstan analyse --error-format=github | |
| - name: Lint Frontend | |
| run: npm run lint | |
| release: | |
| name: Bump Version and Build Docker Image | |
| needs: [tests, lint] | |
| if: | | |
| github.ref == 'refs/heads/main' && | |
| github.event_name == 'push' && | |
| needs.tests.result == 'success' && | |
| needs.lint.result == 'success' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Bump version and push tag | |
| id: tag_version | |
| uses: mathieudutour/github-tag-action@v6.2 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| default_bump: ${{ github.event.inputs.version_type || 'patch' }} | |
| create_annotated_tag: true | |
| release_branches: main | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Parse semver from tag | |
| id: semver | |
| run: | | |
| TAG="${{ steps.tag_version.outputs.new_tag }}" | |
| VERSION="${TAG#v}" | |
| IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION" | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "major=$MAJOR" >> $GITHUB_OUTPUT | |
| echo "minor=$MINOR" >> $GITHUB_OUTPUT | |
| echo "patch=$PATCH" >> $GITHUB_OUTPUT | |
| echo "major_minor=$MAJOR.$MINOR" >> $GITHUB_OUTPUT | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/${{ github.repository }} | |
| tags: | | |
| type=raw,value=${{ steps.tag_version.outputs.new_tag }} | |
| type=raw,value=v${{ steps.semver.outputs.major_minor }} | |
| type=raw,value=v${{ steps.semver.outputs.major }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| target: application | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| platforms: linux/amd64 | |
| - name: Create GitHub Release | |
| uses: ncipollo/release-action@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag: ${{ steps.tag_version.outputs.new_tag }} | |
| name: Release ${{ steps.tag_version.outputs.new_tag }} | |
| body: | | |
| ## Release ${{ steps.tag_version.outputs.new_tag }} | |
| ${{ steps.tag_version.outputs.changelog }} | |
| draft: false | |
| prerelease: false |