Skip to content

Merge pull request #3 from No-Country-simulation/back-feat/surgery #3

Merge pull request #3 from No-Country-simulation/back-feat/surgery

Merge pull request #3 from No-Country-simulation/back-feat/surgery #3

Workflow file for this run

name: Build and Publish Backend Docker Image
on:
push:
branches:
- dev
pull_request:
branches:
- dev
jobs:
build:
runs-on: ubuntu-latest
env:
IMAGE_NAME: tony203/veterinaria
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'
- name: Build with Maven
run: mvn -f ./Backend/pom.xml clean package -DskipTests
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
run: |
docker build -t ${{ env.IMAGE_NAME }}:latest ./Backend
docker push ${{ env.IMAGE_NAME }}:latest
- name: Logout from Docker Hub
run: docker logout