name: ASF-docker-ci

on: [push, pull_request]

env:
  PLATFORMS: linux/amd64,linux/arm,linux/arm64

permissions: {}

jobs:
  main:
    strategy:
      fail-fast: false
      matrix:
        configuration: [Debug, Release]
        file: [Dockerfile, Dockerfile.Service]

    runs-on: ubuntu-latest

    steps:
    - name: Checkout code
      uses: actions/checkout@v4.1.1
      with:
        show-progress: false
        submodules: recursive

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

    - name: Build ${{ matrix.configuration }} Docker image from ${{ matrix.file }}
      uses: docker/build-push-action@v5.3.0
      with:
        context: .
        file: ${{ matrix.file }}
        platforms: ${{ env.PLATFORMS }}
        build-args: |
          CONFIGURATION=${{ matrix.configuration }}
          STEAM_TOKEN_DUMPER_TOKEN=${{ secrets.STEAM_TOKEN_DUMPER_TOKEN }}
