name: Reset docker state
on: workflow_dispatch

jobs:
  reset:
    runs-on: host-arch-x86_64
    name: Reset docker state
    steps:
      - name: Stop all containers
        run: docker stop $(docker ps -a | cut -d " " -f 1 | tail -n +2)
      
      - name: Remove all containers
        run: docker rm $(docker ps -a | cut -d " " -f 1 | tail -n +2)

      - name: Remove extra volumes
        run: docker volume rm road_vision_postgres_data road_vision_pgadmin-data
