Curves of minimal action over metric spaces