DEV Community

Yuval Greenfield
Yuval Greenfield

Posted on

Github page, which version are you anyway?

I was working on my game and couldn't figure out which version was deployed to github pages. So I added this to my github deploy action:

- name: save version.json file
  run: >
    echo '{ "hash": "'$(git rev-parse HEAD)'" }' > dist/version.json
Enter fullscreen mode Exit fullscreen mode

And now I can see the git hash of the live version at

I could probably also include more information like a label and show it in the game. But this is good enough for my needs. I'll probably include that line in all my github page deploys. Note you may or may not need to store the version.json in a dist folder. Cheers.

Top comments (0)