Basically the god Enlil is angry and decides to destroy the race of man by drowning. However Enki, God of wisdom and lord of the Earth, betrays the secret to Uta-Napishtim, who lived in the village of Shuruppak on the middle Euphrates.
Part of the Poem is an account by Uta-Napishtim, to Gilgamesh as to how he earned immortality.
After the tip off, he built a ship:
What I had, I loaded thereon, and the whole harvest of life I caused to embark within the vessel; all my family and relations, The beasts of the field, the cattle of the field, the craftsmen, I made them all embark. I entered the vessel and closed the door To guide the vessel, to Putzur-Enlil, the boatman, I entrusted the structure with its contents. When the young dawn gleamed forth, From the foundation of heaven a black cloud arose. Adad [God of the hurricane] roared at it: Nabu [Herald of the gods] and the king [the god Marduk] march in front: They come, the heralds, by mountain and field; Nergal [God of war] seizeth the mast He goeth, Inurta [God of the nether-world] he leadeth on the attack; The annunaki [infernal spirits] have brought their torches With their light they enveloped the lands; The tumult of Adad ascends to the skies; All that is bright, is turned to darkness. . . The brother seeth his brother no more, The folks of the skies no longer can recognise each other. The gods feared the flood, They fled, they climb into the heavens of Anu. The gods crouched, like a dog on a wall, they lay down . . . For six days and nights Wind and flood marched on, the hurricane subdued the land. When the seventh day dawned the hurricane was abated, the flood Which had waged war like an army; The sea was stilled, the ill wind was calm, the flood ceased. I beheld the sea, its voice was silent, And all mankind was turned into mud! As high as the roofs reached the swamp! I opened my window and the light fell on my cheek, I made for shore and stayed seated; I wept: Over my cheeks flowed my tears. I beheld the world, the horizon of sea; Twelve (measures) away an island emerged. Unto mount Nitsir [between the Tigris and the Lesser Zab] came the vessel. Mount Nitsir held the vessel and let it not budge . . . When the seventh day came, I sent forth a dove, I released it; It went, the dove, it came back: As there was no place, it came back. I sent forth a swallow, it came back: As there was no place, it came back. I sent forth a crow, I released it, It went the crow, and beheld the subsidence of the waters: It eats, it splashes about, it caws, it comes not back. I sent them forth to the four winds, I poured a libation. I set an offering on top of the mountain. I set fourteen adagurru-pots, Under them I spread reeds, cedar, and myrtle -- The gods scented its savour, The gods scented the sweet savour, Like flies, the gods gathered above the sacrifice.Reference: