This paper presents a framework for modeling failure in quasi-brittle geomaterials under different loading conditions. A micromechanics-based model is proposed in which the field variables are linked to physical mechanisms at the microcrack level: damage is related to the growth of microcracks, while plasticity is related to the frictional sliding of closed microcracks. Consequently, the hardening/softening functions and parameters entering the free energy follow from the definition of a single degradation function and the elastic material properties. The evolution of opening microcracks in tension leads to brittle behavior and mode I fracture, while the evolution of closed microcracks under frictional sliding in compression/shear leads to ductile behavior and mode II fracture. Frictional sliding is endowed with a non-associative law, a crucial aspect of the model that considers the effect of dilation and allows for realistic material responses with non-vanishing frictional energy dissipation. Despite the non-associative law, a variationally consistent formulation is presented using notions of energy balance and stability, following the energetic formulation for rate-independent systems. The material response of the model is first described, followed by several benchmark finite element simulations. The results highlight the ability of the model to describe tensile, shear, and mixed-mode fracture, as well as responses with brittle-to-ductile transition. A key result is that, by virtue of the micromechanical arguments, realistic failure modes can be captured, without resorting to the usual heuristic modifications considered in the phase-field literature. The numerical results are thoroughly discussed with reference to previous numerical studies, experimental evidence, and analytical fracture criteria.