add treatment change #88
This file contains 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: Build, Publish, and Auto-Deploy Backend | |
on: | |
push: | |
branches: | |
- dev | |
- main | |
pull_request: | |
branches: | |
- dev | |
- main | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
env: | |
IMAGE_NAME: tony203/veterinaria | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
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@v2 | |
- 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 | |
- name: Deploy to Render | |
env: | |
deploy_url: ${{ secrets.RENDER_DEPLOY_HOOK_URL }} | |
run: | | |
curl -X GET ${{ env.deploy_url }} |