This repository was archived by the owner on Nov 23, 2025. It is now read-only.
fix: Correct file references in Kubernetes deployment workflow #8
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 and Package Service | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| - 'devOps' | |
| - 'dev' | |
| pull_request: | |
| branches: | |
| - 'main' | |
| - 'devOps' | |
| - 'dev' | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| build-test: | |
| name: Install and Build (Tests Skipped) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Cache Maven packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Build with Maven (Skip Tests) | |
| run: mvn -B clean package -DskipTests --file project-service/pom.xml | |
| - name: Upload Build Artifact (JAR) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: project-service-jar | |
| path: project-service/target/*.jar | |
| build-and-push-docker: | |
| name: Build & Push Docker Image | |
| if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/devOps' || github.ref == 'refs/heads/dev' | |
| runs-on: ubuntu-latest | |
| needs: build-test | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download JAR Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: project-service-jar | |
| path: project-service/target/ | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/techtorque-2025/project_service | |
| tags: | | |
| type=sha,prefix= | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} |