Skip to content

Build and Publish Docker Images #14

Build and Publish Docker Images

Build and Publish Docker Images #14

Workflow file for this run

name: Build and Publish Docker Images
on:
release:
types: [created]
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Build backend
run: |
./gradlew bootJar -x test
- name: Inspect built jar
run: |
echo "Current directory:"
pwd
echo "Listing all files recursively:"
ls -R
echo "Listing build/libs specifically:"
ls -l build/libs
echo "Contents of the jar (first 20 lines):"
jar -tf build/libs/*.jar | head -n 20
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
- name: Build and push Docker image
run: |
docker build -t ${{ secrets.DOCKERHUB_USER }}/brava-tools-be:latest .
docker push ${{ secrets.DOCKERHUB_USER }}/brava-tools-be:latest