fix format for ssh key #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: master | |
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 }} PRIVATE_KEY=${{ secrets.PRIVATE_KEY }} thc build game | |
- name: Provide dapp | |
run: ETHEREUM_ENDPOINT=${{ secrets.ETHEREUM_ENDPOINT }} PRIVATE_KEY=${{ secrets.PRIVATE_KEY }} 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 | |
env: | |
VITE_RPC_NODE_URL: ${{ secrets.VITE_RPC_NODE_URL }} | |
VITE_WALLET_CONNECT_PROJECT_ID: ${{ secrets.VITE_WALLET_CONNECT_PROJECT_ID }} | |
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 | |
- name: Update root hash | |
run: ETHEREUM_ENDPOINT=${{ secrets.ETHEREUM_ENDPOINT }} PRIVATE_KEY=${{ secrets.PRIVATE_KEY }} thc set-root-hash game |