If the intention behind their good deeds is a desire (whether the person be aware of it or not) to earn fame for that good deed (for others to respect him, like him or etc), or anything like that (e.g. some people are polite for others to be polite about them, help the others to be helped by the others, respect the others to be respected by the others, and many more) then the answer is that they will have nothing in the Day and its beyond:
مَن كَانَ يُرِيدُ الْحَيَاةَ الدُّنْيَا وَزِينَتَهَا نُوَفِّ
إِلَيْهِمْ أَعْمَالَهُمْ فِيهَا وَهُمْ فِيهَا لَا يُبْخَسُونَ /
أُولَٰئِكَ الَّذِينَ لَيْسَ لَهُمْ فِي الْآخِرَةِ إِلَّا النَّارُ ۖ
وَحَبِطَ مَا صَنَعُوا فِيهَا وَبَاطِلٌ مَّا كَانُوا يَعْمَلُونَ
Those who desire the life of the present and its glitter,- to them we
shall pay (the price of) their deeds therein,- without diminution. /
They are those for whom there is nothing in the Hereafter but the
Fire: vain are the designs they frame therein, and of no effect and
the deeds that they do!
Also an example of such people is Samiri:
قَالَ فَاذْهَبْ فَإِنَّ لَكَ فِي الْحَيَاةِ أَن تَقُولَ لَا مِسَاسَ ۖ
وَإِنَّ لَكَ مَوْعِدًا لَّن تُخْلَفَهُ ۖ وَانظُرْ إِلَىٰ إِلَٰهِكَ
الَّذِي ظَلْتَ عَلَيْهِ عَاكِفًا ۖ لَّنُحَرِّقَنَّهُ ثُمَّ
لَنَنسِفَنَّهُ فِي الْيَمِّ نَسْفًا
(Moses) said: "Get thee gone! but thy (punishment) in this life will
be that thou wilt say, 'touch me not'; and moreover (for a future
penalty) thou hast a promise that will not fail: Now look at thy god,
of whom thou hast become a devoted worshipper: We will certainly
(melt) it in a blazing fire and scatter it broadcast in the sea!"
he made an idol after Israelites weren under teachings of Moses (peace be upon him), so it seems that he should have been killed not only being banished. The reason for this was asked from a Shia Imam (peace be upon him) and he answered that was a punishment-lowering by God since Allah liked him being very generous! See how Allah paid Samiri back in this world for him to have nothing in Hereafter but the fire.
Everywhere in Quran we are told that good deed is indeed good only if it follows fate (in Allah and the Hereafter), and fate will not lead to Heaven but only if is followed by righteous deeds, since Allah wants us to be truthful (honest), confessing Allah is unique and that we are submitted to Him but on the other hand doing whatever that we desire is not really truthfully! The importance of truthfulness and honesty in this respect is such that you can measure fate with this single parameter! So we have "the most truthful"s (Seddiqeen: الصدیقین) in Quran as those with highest ranks in the view of Allah. Now see some witnesses from Quran addressing the point:
بِسمِ اللَّـهِ الرَّحمـٰنِ الرَّحيمِ وَالعَصرِ / إِنَّ الإِنسـٰنَ لَفى
خُسرٍ / إِلَّا الَّذينَ ءامَنوا وَعَمِلُوا الصّـٰلِحـٰتِ وَتَواصَوا
بِالحَقِّ وَتَواصَوا بِالصَّبرِ
In the name of Allah, the Entirely Merciful, the Especially Merciful.
By time / Indeed, mankind is in loss / Except for those who have
believed and done righteous deeds and advised each other to truth and
advised each other to patience. [Surah Al-Asr]
or many verses in which Allah guarantees Heaven for only those who bring both fate and righteous deeds together, e.g.: [2:25], [2:82], [2:277], [3:57], [4:57], [4:122], [5:9], [7:42], [10:9] and many others. Now look at [5:119] which reads:
قالَ اللَّـهُ هـٰذا يَومُ يَنفَعُ الصّـٰدِقينَ صِدقُهُم ۚ لَهُم
جَنّـٰتٌ تَجرى مِن تَحتِهَا الأَنهـٰرُ خـٰلِدينَ فيها أَبَدًا ۚ رَضِىَ
اللَّـهُ عَنهُم وَرَضوا عَنهُ ۚ ذٰلِكَ الفَوزُ العَظيمُ
Allah will say, "This is the Day when the truthful will benefit from
their truthfulness." For them are gardens [in Paradise] beneath which
rivers flow, wherein they will abide forever, Allah being pleased with
them, and they with Him. That is the great attainment.
يـٰأَيُّهَا الَّذينَ ءامَنُوا اتَّقُوا اللَّـهَ وَكونوا مَعَ
الصّـٰدِقينَ
O you who have believed, fear Allah and be with those who are true.
[9:119]
لِيَسـَٔلَ الصّـٰدِقينَ عَن صِدقِهِم ۚ وَأَعَدَّ لِلكـٰفِرينَ عَذابًا
أَليمًا
That He may question the truthful about their truth. And He has
prepared for the disbelievers a painful punishment. [33:8]
لِيَجزِىَ اللَّـهُ الصّـٰدِقينَ بِصِدقِهِم وَيُعَذِّبَ المُنـٰفِقينَ
إِن شاءَ أَو يَتوبَ عَلَيهِم ۚ إِنَّ اللَّـهَ كانَ غَفورًا رَحيمًا
That Allah may reward the truthful for their truth and punish the
hypocrites if He wills or accept their repentance. Indeed, Allah is
ever Forgiving and Merciful. [33:24]
إِنَّمَا المُؤمِنونَ الَّذينَ ءامَنوا بِاللَّـهِ وَرَسولِهِ ثُمَّ لَم يَرتابوا وَجـٰهَدوا بِأَموٰلِهِم وَأَنفُسِهِم فى سَبيلِ اللَّـهِ ۚ
أُولـٰئِكَ هُمُ الصّـٰدِقونَ
The believers are only the ones who have believed in Allah and His
Messenger and then doubt not but strive with their properties and
their lives in the cause of Allah. It is those who are the truthful.
[49:15]
يَمُنّونَ عَلَيكَ أَن أَسلَموا ۖ قُل لا تَمُنّوا عَلَىَّ إِسلـٰمَكُم ۖ
بَلِ اللَّـهُ يَمُنُّ عَلَيكُم أَن هَدىٰكُم لِلإيمـٰنِ إِن كُنتُم
صـٰدِقينَ
They consider it a favor to you that they have accepted Islam. Say,
"Do not consider your Islam a favor to me. Rather, Allah has conferred
favor upon you that He has guided you to the faith, if you should be
truthful." [49:17]
لِلفُقَراءِ المُهـٰجِرينَ الَّذينَ أُخرِجوا مِن دِيـٰرِهِم
وَأَموٰلِهِم يَبتَغونَ فَضلًا مِنَ اللَّـهِ وَرِضوٰنًا وَيَنصُرونَ
اللَّـهَ وَرَسولَهُ ۚ أُولـٰئِكَ هُمُ الصّـٰدِقونَ
For the poor emigrants who were expelled from their homes and their
properties, seeking bounty from Allah and [His] approval and
supporting Allah and His Messenger, [there is also a share]. Those are
the truthful. [59:8]
أَحَسِبَ النّاسُ أَن يُترَكوا أَن يَقولوا ءامَنّا وَهُم لا
يُفتَنونَ / وَلَقَد فَتَنَّا الَّذينَ مِن قَبلِهِم ۖ فَلَيَعلَمَنَّ
اللَّـهُ الَّذينَ صَدَقوا وَلَيَعلَمَنَّ الكـٰذِبينَ
Do the people think that they will be left to say, "We believe" and
they will not be tried? / But We have certainly tried those before
them, and Allah will surely make evident those who are truthful, and
He will surely make evident the liars. [29:2,3]
Also see
وَمَن يُطِعِ اللَّـهَ وَالرَّسولَ فَأُولـٰئِكَ مَعَ الَّذينَ أَنعَمَ
اللَّـهُ عَلَيهِم مِنَ النَّبِيّـۧنَ وَ الصِّدّيقينَ وَالشُّهَداءِ
وَالصّـٰلِحينَ ۚ وَحَسُنَ أُولـٰئِكَ رَفيقًا
And whoever obeys Allah and the Messenger - those will be with the
ones upon whom Allah has bestowed favor of the prophets, the
steadfast affirmers of truth, the martyrs and the righteous. And
excellent are those as companions. [4:69]
However, we also have Ahl-ul-A'raaf which may point to those you have question about more directly:
وَبَينَهُما حِجابٌ ۚ وَعَلَى الأَعرافِ رِجالٌ يَعرِفونَ كُلًّا
بِسيمىٰهُم ۚ وَنادَوا أَصحـٰبَ الجَنَّةِ أَن سَلـٰمٌ عَلَيكُم ۚ لَم
يَدخُلوها وَهُم يَطمَعونَ / وَإِذا صُرِفَت أَبصـٰرُهُم تِلقاءَ
أَصحـٰبِ النّارِ قالوا رَبَّنا لا تَجعَلنا مَعَ القَومِ الظّـٰلِمينَ /
وَنادىٰ أَصحـٰبُ الأَعرافِ رِجالًا يَعرِفونَهُم بِسيمىٰهُم قالوا ما
أَغنىٰ عَنكُم جَمعُكُم وَما كُنتُم تَستَكبِرونَ / أَهـٰؤُلاءِ الَّذينَ
أَقسَمتُم لا يَنالُهُمُ اللَّـهُ بِرَحمَةٍ ۚ ادخُلُوا الجَنَّةَ لا
خَوفٌ عَلَيكُم وَلا أَنتُم تَحزَنونَ
And between them will be a partition, and on [its] elevations are men
who recognize all by their mark. And they call out to the companions
of Paradise, "Peace be upon you." They have not [yet] entered it, but
they long intensely. / And when their eyes are turned toward the
companions of the Fire, they say, "Our Lord, do not place us with the
wrongdoing people." / And the companions of the Elevations will call
to men [within Hell] whom they recognize by their mark, saying, "Of no
avail to you was your gathering and [the fact] that you were
arrogant." / [Allah will say], "Are these the ones whom you
[inhabitants of Hell] swore that Allah would never offer them mercy?
Enter Paradise, [O People of the Elevations]. No fear will there be
concerning you, nor will you grieve." [7:46-49]
These are people who were not people of fate, but was not among the arrogant wrongdoers as well, so they will not enter the paradise for their good deeds but Allah will give them mercy and enter them paradise for He is the most Merciful.
So you see, things are a little bit more complex to answer you in a single line, every judgment should concern both the deeds and their behind intentions. People are arrogant if they understand the truth but prefer this life over the Hereafter, like they know better than God, like it is not important what God and his messengers are saying, but there are people who have not heard the massage
and are going by their own good will. But Allah knows best. Others may be able to help you better.