Skip to content

fix deploy

fix deploy #7

Workflow file for this run

name: Deploy game
on:
push:
branches:
- main
jobs:
build:
name: "Build"
runs-on: ubuntu-latest
steps:
- name: Checkout game
uses: actions/checkout@v4
with:
path: game
- name: Checkout THC (as in Treasure Hunt Code)
uses: actions/checkout@v4
with:
repository: social-dist0rtion-protocol/thc
ref: dev
path: thc
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
cache-dependency-path: "thc"
- name: Install THC (as in Treasure Hunt CLI)
run: pnpm install -g @dist0rtion/thc
- name: Build game
run: ETHEREUM_ENDPOINT=${{ secrets.ETHEREUM_ENDPOINT }} thc build game
- name: Provide dapp
run: ETHEREUM_ENDPOINT=${{ secrets.ETHEREUM_ENDPOINT }} thc provide-dapp game thc/web
- name: Install THC (as in Treasure Hunt Code) lib deps
working-directory: thc/lib
run: pnpm install
- name: Install THC (as in Treasure Hunt Code) web deps
working-directory: thc/web
run: pnpm install
- name: Build
working-directory: thc/web
run: pnpm build
- name: Load SSH Key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.DEPLOYER_SSH_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
- name: Deploy to Target Repo
run: |
git clone [email protected]:${{ secrets.TARGET_REPO }}.git target
cp -R thc/web/dist/* target/
cd target
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "Bump"
git push origin main