Based on a board game.
Forked from this commit of pig-card-game.
npm install
npm start
- This starts 4 docker containersrobot-race-server
: handles http requestsrobot-race-worker
: handles game logicrobot-race-front-end
: rebuilds front-end during developmentredis
: a Redis instance
- Click the fork button
- Create new empty repository on GitHub (or whatever)
git clone https://github.com/nick-ng/robot-race.git <new-repo> && cd <new-repo>
- Change
robot-race
to whatever you want and change my name to your name or something. git add . && git commit -m "anything. this will get squashed in the next step"
git reset $(git commit-tree HEAD^{tree} -m "forked https://github.com/nick-ng/robot-race")
git remote remove origin
git remote add origin <url-of-repo-you-made>
git push --set-upstream origin main
- Change branch permissions etc.
./build.sh
ordocker compose -f docker-compose.prod.yml build
./serve.sh
orPORT=<desired-port> docker compose -f docker-compose.prod.yml up -d
- Change
.github\workflows\deploy-front-end.yml
so theAPI_ORIGIN
is your Heroku App's url e.g.API_ORIGIN=https://${{secrets.HEROKU_APP_NAME}}.herokuapp.com
- Create an empty Heroku App. Note the app's name
- Get your Heroku API key from https://dashboard.heroku.com/account
- On GitHub repo for your fork, go to the Settings and click on Secrets > Actions
- Add 3 new repository secrets
HEROKU_API_KEY
: API key from aboveHEROKU_APP_NAME
: App name from aboveHEROKU_EMAIL
: Email address of your Heroku account
- Push a commit to the
main
branch - Manually run the "Deploy Back-end" GitHub action
If you deploy to Heroku often, you can un-comment the "push" trigger in .github\workflows\deploy-back-end.yml
Create a /spec
directory next to the files you want to test then create a file <name-of-file-to-test>.spec.cjs
in that.
Check this GitHub Project for details.