feat: initialize crypto_clash_contract with TypeScript, Hardhat, and deployment script

- Added package.json with scripts for compiling, deploying, and testing the contract.
- Created deploy.ts script for deploying the HelloWorld contract and saving the contract address to config.json.
- Configured TypeScript with tsconfig.json for Node.js environment and ES module support.
This commit is contained in:
averel10
2025-11-11 21:01:16 +01:00
parent b27ae2dc5d
commit 44bc814114
11 changed files with 1673 additions and 6 deletions

54
.github/workflows/deploy_frontend.yml vendored Normal file
View File

@@ -0,0 +1,54 @@
name: Deploy frontend
on:
push:
branches:
- main
paths:
- 'crypto_clash_frontend/**'
- '.github/workflows/deploy_frontend.yml'
- 'config.json'
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build-frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v6
with:
# update the Node version to meet your needs
node-version: 24
cache: npm
cache-dependency-path: crypto_clash_frontend/package-lock.json
- name: Build with Next.js
run: npm ci && npm run build
working-directory: crypto_clash_frontend
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./crypto_clash_frontend/out
deploy-frontend:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs:
- build-frontend
steps:
- name: Publish to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4