name: 'build-and-push'

on:
  push:
    branches:
      - master

jobs:
  push:
    runs-on: ubuntu-latest
 
    steps:
      - name: 'checkout'
        uses: actions/checkout@v4
      - name: Set up Docker Context for Buildx
        run: docker context create builders
      - name: 'setup buildx'
        uses: docker/setup-buildx-action@v3
        with:
          config-inline: |
            [registry."192.168.0.151:32000"]
            http = true
            insecure = true
              
      - name: 'Build and push Docker image'
        uses: docker/build-push-action@v5
        with:
          context: .
          file: ./Dockerfile
          push: true
          tags: "192.168.0.151:32000/crawler:${{gitea.sha}},192.168.0.151:32000/crawler:latest"
