fix: Register JWT classes for GraalVM reflection #95
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: Backend CI/CD | |
| on: | |
| push: | |
| branches: [ "main", "master" ] | |
| workflow_dispatch: | |
| env: | |
| IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/jobapplytracker-backend | |
| jobs: | |
| test-and-build: | |
| name: Test and Build (Native) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up GraalVM | |
| uses: graalvm/setup-graalvm@v1 | |
| with: | |
| java-version: '21' | |
| distribution: 'graalvm' | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| cache: maven | |
| - name: Build Native Binary | |
| run: mvn -Pnative native:compile -DskipTests -B -ntp | |
| - name: Upload Native Binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: native-executable | |
| path: target/app-native | |
| if-no-files-found: error | |
| publish-image: | |
| name: Publish Image | |
| needs: test-and-build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Download Native Binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: native-executable | |
| path: ./target/ | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - 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 image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| tags: ${{ env.IMAGE_NAME }}:latest | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| deploy-vps: | |
| name: Deploy to VPS | |
| needs: publish-image | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy via SSH | |
| uses: appleboy/ssh-action@v1.2.0 | |
| with: | |
| host: ${{ secrets.VPS_IP }} | |
| username: ${{ secrets.VPS_USER }} | |
| key: ${{ secrets.SSH_KEY }} | |
| script: | | |
| cd /docker/jobpplytracker-api | |
| docker compose pull | |
| docker compose up -d --remove-orphans | |
| docker image prune -f |