name: docker

on:
  workflow_dispatch:
  pull_request:
    paths:
      - 'backend/**'
      - 'frontend/**'
      - 'docker-compose.yml'
  push:
    branches:
      - 'master'

jobs:
  build_docker:
    runs-on: ubuntu-22.04

    steps:
      - uses: actions/checkout@v4

      - name: Build backend Docker image
        run: sudo docker build .
        working-directory: backend

      - name: Build frontend Docker image
        run: sudo docker build .
        working-directory: frontend
