Skip to content

Updated API requests for frontend client #27

Updated API requests for frontend client

Updated API requests for frontend client #27

name: Publish klabis/backend Docker Image
on:
push:
branches:
- main
paths:
- 'backend/**'
- '.github/workflows/backend_publish.yml'
workflow_dispatch: # Manual trigger
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '21'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Publish Docker Image
working-directory: backend
run: |
# Build the Docker image and tag it with both the 'latest', commit hash, and tag if exist
./gradlew bootBuildImage --imageName=ghcr.io/zabiny/klabis-be:latest
docker tag ghcr.io/zabiny/klabis-be:latest ghcr.io/zabiny/klabis-be:$(git rev-parse --short HEAD)
docker push -a ghcr.io/zabiny/klabis-be
- name: Verify image
run: docker images
- name: Deploy to Coolify
run: |
curl --request GET '${{ secrets.COOLIFY_WEBHOOK_BE }}' --header 'Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}'