name: nightly and on.push docker builds

on:
  push:
    branches:
      - 'main'

  schedule:
    # * is a special character in YAML so you have to quote this string
    # triggers every day at 00:00 UTC (midnight)
    - cron:  '0 0 * * *'

jobs:
  docker:
    runs-on: ubuntu-latest
    steps:
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v2

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

      - name: Login to Docker Hub
        uses: docker/login-action@v2
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}

      - name: Build and push - no install
        uses: docker/build-push-action@v4
        with:
          push: true
          tags: | 
            jessebot/onboardme:debian12-no-install
            jessebot/onboardme:no-install

      - name: Build and push - slim
        uses: docker/build-push-action@v4
        with:
          push: true
          build-args: "RUN_MODE=default"
          tags: |
            jessebot/onboardme:latest
            jessebot/onboardme:debian12
