name: Check Jolt Docker Image

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
  workflow_dispatch:

jobs:
  build_jolt_image:
    name: Build Jolt Docker Image
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3

      - name: Build dependent Docker base image
        run: |
          docker build \
            --file docker/base/Dockerfile.base \
            --tag ere-base:latest \
            .

      - name: Build Jolt Docker image
        run: |
          docker build \
            --file docker/jolt/Dockerfile \
            --tag ere-builder-jolt-check:latest \
            .