Skip to content

Deploy Demo

Deploy Demo #34

name: Deploy Demo
on:
# Runs on pushes targeting the default branch
push:
branches: ['main']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: 'pages'
cancel-in-progress: true
jobs:
build-and-deploy-contracts:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./contracts
outputs:
WORLD_ADDRESS: ${{ steps.deploy.outputs.WORLD_ADDRESS }}
env:
STARKNET_RPC_URL: ${{ vars.STARKNET_RPC_URL }}
DEPLOYER_ADDRESS: ${{ vars.DEPLOYER_ADDRESS }}
DEPLOYER_PRIVATE_KEY: ${{ secrets.DEPLOYER_PRIVATE_KEY }}
steps:
- uses: actions/checkout@v3
- run: curl -L https://install.dojoengine.org | bash
- run: /home/runner/.config/.dojo/bin/dojoup --version v0.3.15
- id: deploy
run: |
/home/runner/.config/.dojo/bin/sozo build
WORLD_ADDRESS=$(/home/runner/.config/.dojo/bin/sozo migrate --name="arcane" --rpc-url="$STARKNET_RPC_URL" --account-address="$DEPLOYER_ADDRESS" --private-key="$DEPLOYER_PRIVATE_KEY" | grep "at address" | grep -oE9 '(0x[a-fA-F0-9]{63})')
echo "WORLD_ADDRESS=$WORLD_ADDRESS" >> "$GITHUB_OUTPUT"
print-world-address:
runs-on: ubuntu-latest
needs: build-and-deploy-contracts
steps:
- run: echo ${{ needs.build-and-deploy-contracts.outputs.WORLD_ADDRESS }}
# build-and-deploy:
# runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: ./renjs-client
# steps:
# - uses: actions/checkout@v4
# - name: Use bun
# uses: oven-sh/setup-bun@v1
# - run: bun install
# - run: bun run build
# - name: Setup Pages
# uses: actions/configure-pages@v3
# - name: Upload artifact
# uses: actions/upload-pages-artifact@v1
# with:
# path: './renjs-client/dist'
# - name: Deploy to GitHub Pages
# id: deployment
# uses: actions/deploy-pages@v1