| name: Build and Push Docker Images | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| workflow_dispatch: # Allows you to run it manually | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| # Build the API (The Brain) | |
| - name: Build and push API | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| tags: ${{ secrets.DOCKER_USERNAME }}/med-gemma-api:latest | |
| # Build the Frontend (The Face) | |
| - name: Build and push Frontend | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./frontend | |
| file: ./frontend/Dockerfile | |
| push: true | |
| tags: ${{ secrets.DOCKER_USERNAME }}/med-gemma-web:latest |