The trick is to have a pair of values on each face that are one number apart but not adjacent to each other. First corner is one, cannot be adjacent to two, so you can assign 3 to the second side. This means four should go opposite three, and the least number for the spot between three and four is six.
The bottom cannot begin with two because that would be adjacent to one, so the next lowest is five.seven and eight have to go under three and four as they are one apart and thus cannot be placed adjacent to each other. That leaves two to go under six.
clockwise around the top 1-3-6-4
clockwise around the bottom 5-7-2-8
1 is adjacent to 3,4,5
2 is adjacent to 7,8,6
3 is adjacent to 1,6,7
4 is adjacent to 6,1,8
5 is adjacent to 7,8,1
6 is adjacent to 3,4,2
7 is adjacent to 5,2,3
8 is adjacent to 2,5,4