name: Build and deploy arke starter

on:
  workflow_dispatch:
  push:
    branches: ["main"]

jobs:
  build:
    name: Build and test
    runs-on: ubuntu-latest
    concurrency:
      group: ci-${{ github.ref }}
      cancel-in-progress: true

    steps:
      - uses: actions/checkout@v3

      - name: Build & push Docker image 🐳
        uses: mr-smithers-excellent/docker-build-push@v5
        with:
          image: <%= String.downcase(@app_module) %>
          tags: latest
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
          buildArgs: MIX_ENV=${{ secrets.MIX_ENV }}
        env:
          MIX_ENV: ${{ secrets.MIX_ENV }}
