diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 337d83be..ac174979 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -549,82 +549,3 @@ jobs: "$IMAGE@$AMD64_DIGEST" \ "$IMAGE@$ARM64_DIGEST" done <<< "$TAGS" - - deploy: - runs-on: ubuntu-latest - needs: [tests, linter, static-analysis, performance-tests, changes] - if: github.ref == 'refs/heads/main' && github.event_name == 'push' && needs.changes.outputs.code == 'true' - env: - SENTRY_RELEASE: whisper-money@${{ github.sha }} - concurrency: - group: production-deploy-main - cancel-in-progress: true - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Check if this is the latest main commit - id: deploy_guard - run: | - latest_main_sha=$(git ls-remote origin refs/heads/main | cut -f1) - - echo "Current workflow SHA: ${{ github.sha }}" - echo "Latest main SHA: $latest_main_sha" - - if [ -z "$latest_main_sha" ]; then - echo "Unable to determine the latest main SHA." - exit 1 - fi - - if [ "$latest_main_sha" != "${{ github.sha }}" ]; then - echo "This workflow is not for the latest commit on main. Skipping deploy." - echo "should_deploy=false" >> "$GITHUB_OUTPUT" - exit 0 - fi - - echo "This workflow is for the latest commit on main. Proceeding with deploy." - echo "should_deploy=true" >> "$GITHUB_OUTPUT" - - - name: Trigger deployment - if: steps.deploy_guard.outputs.should_deploy == 'true' - run: | - # Fire the webhook and let curl own the timeouts/retries: --max-time - # caps each attempt so the job can't hang, and --retry-all-errors - # turns a timed-out attempt into the next retry. - curl --fail \ - --connect-timeout 10 \ - --max-time 15 \ - --retry 3 \ - --retry-delay 10 \ - --retry-all-errors \ - -i -X GET "${{ secrets.COOLIFY_WEBHOOK_URL }}" - - - name: Install Sentry CLI - if: steps.deploy_guard.outputs.should_deploy == 'true' - run: curl -sL https://sentry.io/get-cli/ | bash - - - name: Create Sentry release - if: steps.deploy_guard.outputs.should_deploy == 'true' - env: - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - SENTRY_ORG: ${{ secrets.SENTRY_ORG }} - SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} - run: | - if ! sentry-cli releases info "$SENTRY_RELEASE" >/dev/null 2>&1; then - sentry-cli releases new "$SENTRY_RELEASE" - fi - - sentry-cli releases set-commits "$SENTRY_RELEASE" --auto --ignore-missing - sentry-cli releases finalize "$SENTRY_RELEASE" - - - name: Mark Sentry release deployed - if: steps.deploy_guard.outputs.should_deploy == 'true' - env: - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - SENTRY_ORG: ${{ secrets.SENTRY_ORG }} - SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} - run: sentry-cli releases deploys "$SENTRY_RELEASE" new -e production - - - name: Deployment skipped - if: steps.deploy_guard.outputs.should_deploy == 'false' - run: echo "Skipped deployment because a newer commit is already on main." diff --git a/tests/Feature/SentryConfigTest.php b/tests/Feature/SentryConfigTest.php index 13e2c13d..5d85a975 100644 --- a/tests/Feature/SentryConfigTest.php +++ b/tests/Feature/SentryConfigTest.php @@ -8,12 +8,3 @@ it('disables the sentry dsn outside the production environment', function () { expect(app()->environment())->not->toBe('production') ->and(config('sentry.dsn'))->toBeNull(); }); - -it('does not wait for registry image publishing before marking a sentry deploy', function () { - $workflow = file_get_contents(base_path('.github/workflows/ci.yml')); - - expect($workflow) - ->toContain("deploy:\n runs-on: ubuntu-latest\n needs: [tests, linter, static-analysis, performance-tests, changes]") - ->toContain('sentry-cli releases new "$SENTRY_RELEASE"') - ->toContain('run: sentry-cli releases deploys "$SENTRY_RELEASE" new -e production'); -});