name: Build with DinD on: push: branches: [ main ] jobs: build: runs-on: ubuntu-latest container: image: docker:dind options: --privileged steps: - uses: actions/checkout@v4 - name: Test Docker Access run: | docker --version docker info docker run --rm hello-world - name: Build and Push run: | docker build -t my-image:${{ github.sha }} . # Your push commands here