There's a branch of philosophy called virtue ethics - the philosopher Rosalind Hursthouse would formulate virtue as something like "A virtuous person does the right thing for the right reason and feels the right way about it. A virtuous action is a right action done for the right reasons and accompanied by the right kinds of feelings." This is posed as an alternative to deontology (Kantian ethics), and utilitarianism if you study normative ethics in college.
Virtue ethics is fucking retarded though, even in comparison to most philosophy. It's a bunch of a circular reasoning (I mean seriously, "a virtuous action is the right action?") and navel gazing and is just not intellectually rigorous. But alas, this virtue ethics bullshit was taught to a bunch of undergraduate philosophy majors, and now we have a bunch of assholes posting about "virtue signalling" - what if people do an action... but not for the right reasons, just to appear virtuous! Keep in mind that actually getting a virtue ethicist to pin down what a virtue even is and how it relates to an action is nearly impossible.