Phase 11.6: Async Email Integration with Thread Pool & SMTP Optimization #63
Workflow file for this run
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: Java CI + Docker Publish Pipeline + Deploy to VPS | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| cache: maven | |
| - name: Build and run tests | |
| run: mvn clean verify | |
| docker: | |
| if: github.event_name == 'push' | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v4 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build Docker image | |
| run: | | |
| docker build -t ghcr.io/vimal-java-dev/vimaltech-contact-api:latest . | |
| - name: Push Docker image | |
| run: | | |
| docker push ghcr.io/vimal-java-dev/vimaltech-contact-api:latest | |
| deploy: | |
| # ✅ CRITICAL CONDITION (owner repo only) | |
| if: github.event_name == 'push' && github.repository == 'vimal-java-dev/vimaltech-contact-api' | |
| needs: docker | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy to VPS via SSH | |
| uses: appleboy/ssh-action@v1.0.3 | |
| with: | |
| host: ${{ secrets.VPS_HOST }} | |
| username: ${{ secrets.VPS_USER }} | |
| key: ${{ secrets.VPS_SSH_KEY }} | |
| script: | | |
| /home/deploy/deploy.sh |