feat: introduce payrollperiod embeddable value object #122
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: CI/CD Pipeline | |
| on: | |
| push: | |
| branches: [master, develop] | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| pull_request: | |
| branches: [master, develop] | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| jobs: | |
| unit-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| cache: maven | |
| - name: Run unit tests | |
| run: ./mvnw clean test | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| needs: unit-tests | |
| if: github.ref == 'refs/heads/master' | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '21' | |
| cache: maven | |
| - name: Build with maven | |
| run: ./mvnw clean package -DskipTests | |
| - name: Build Docker image | |
| run: docker build -t ghcr.io/${{ github.repository_owner }}/mysweldo-api:latest . | |
| - name: Log in to GHCR | |
| run: echo "${{ secrets.GHCR_PAT }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin | |
| - name: Push image | |
| run: docker push ghcr.io/${{ github.repository_owner }}/mysweldo-api:latest | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: build-and-push | |
| if: github.ref == 'refs/heads/master' | |
| 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 }} | |
| port: ${{ secrets.VPS_PORT }} | |
| script: | | |
| cd /home/deploy/projects/mysweldo-api/ | |
| echo "Logging into GHCR..." | |
| echo "${{ secrets.GHCR_PAT }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin | |
| echo "Pulling latest image..." | |
| docker compose -f mysweldo-api.compose.yml pull | |
| echo "Restarting services..." | |
| docker compose -f mysweldo-api.compose.yml up -d --remove-orphans |