concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
  cancel-in-progress: true

on:
  workflow_dispatch:
  push:
    branches:
      - devel
  pull_request:
    types:
      - opened
      - reopened
      - synchronize

name: Create Packages (Docker)

jobs:
  build:
    name: "build"
    runs-on: ubuntu-26.04
    if: (github.repository_owner == 'dosemu2')
    steps:
    - uses: actions/checkout@v6
    - name: Set up Docker Buildx
      uses: docker/setup-buildx-action@v3
    - name: Build
      uses: docker/build-push-action@v6
      with:
        context: .
        file: ./Dockerfile.alpine
        push: false
        load: true
        tags: dosemu2:latest
    - name: Test Docker image
      run: |
        docker run dosemu2:latest -dumb -E exit
