The Lord spoke to Moses about the Sabbath, and please note whom the Lord expected to keep the Sabbath,
“Therefore the children of Israel shall keep the Sabbath, to observe the Sabbath throughout their generations as a perpetual covenant. It is a sign between Me and the children of Israel forever; for in six days the Lord made the heavens and the earth, and on the seventh day He rested and was refreshed” (Exodus 31:16–17).
The first sentence clears the matter for us, saying that the children of Israel were to keep the Sabbath, because, as the next sentence says, it was a sign between the Lord and the children of Israel, and the Lord wanted them to imitate His week of creation.
See also Deuteronomy 5:15 and Nehemiah 9:14 that show why the Sabbath was only for Israel, and when He first revealed it to Israel.