Skip to content

Profile card image display #41

Profile card image display

Profile card image display #41

Workflow file for this run

name: Build backend spring boot server
on:
workflow_dispatch:
pull_request:
branches: [main]
types: closed
paths:
- "backend/**"
env:
working-directory: ./backend
MONGO_URI: ${{ secrets.MONGO_URI }}
jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
- name: Build with maven
run: mvn clean install
working-directory: ${{ env.working-directory }}
- name: Login to docker hub
run: docker login -u ${{secrets.DOCKER_USERNAME}} -p ${{secrets.DOCKER_PASSWORD}}
working-directory: ${{ env.working-directory }}
- name: Build docker image
run: docker build -t dominikkovacevic/rimatch -f Dockerfile.prod .
working-directory: ${{ env.working-directory }}
- name: Publish image to docker hub
run: docker push dominikkovacevic/rimatch:latest
Deploy:
needs: Build
runs-on: [aws-ec2]
steps:
- name: Login to docker hub
run: docker login -u ${{secrets.DOCKER_USERNAME}} -p ${{secrets.DOCKER_PASSWORD}}
- name: Pull Image from docker hub
run: docker pull dominikkovacevic/rimatch:latest
- name: Delete old container
run: docker rm -f rimatch-backend-container
- name: Run docker container
run: >
docker run -d -p 8080:8080
-e MONGO_URI="${{ secrets.MONGO_URI }}"
-e CORS_ALLOWED_ORIGINS="${{vars.FRONTEND_URL}}"
-e JWT_SECRET_ACCESS="${{ secrets.JWT_SECRET_ACCESS }}"
-e JWT_SECRET_REFRESH="${{ secrets.JWT_SECRET_REFRESH }}"
-e INFOBIP_API_KEY="${{ secrets.INFOBIP_API_KEY }}"
-e INFOBIP_BASE_URL="${{ secrets.INFOBIP_BASE_URL }}"
-e INFOBIP_SENDER_EMAIL="${{ secrets.INFOBIP_SENDER_EMAIL }}"
-e INFOBIP_PHONE_NUMBER="${{ secrets.INFOBIP_PHONE_NUMBER }}"
--name rimatch-backend-container dominikkovacevic/rimatch