mirror of
https://github.com/averel10/crypto_clash.git
synced 2026-03-12 19:08:11 +01:00
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:
40
.github/workflows/deploy_backend.yml
vendored
Normal file
40
.github/workflows/deploy_backend.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: Deploy Contract
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'crypto_clash_contract/**'
|
||||
- '.github/workflows/deploy_backend.yml'
|
||||
|
||||
jobs:
|
||||
build-and-deploy-contract:
|
||||
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_contract/package-lock.json
|
||||
|
||||
- name: Install dependencies and compile contract
|
||||
run: npm ci && npm run compile && npm run deploy
|
||||
working-directory: crypto_clash_contract
|
||||
env:
|
||||
API_URL: ${{ vars.API_URL }}
|
||||
WALLET_PRIVATE_KEY: ${{ secrets.WALLET_PRIVATE_KEY }}
|
||||
|
||||
- name: Commit deployed contract address
|
||||
run: |
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add config.json
|
||||
git commit -m "Update deployed contract address" || echo "No changes to commit"
|
||||
git push
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -1,9 +1,13 @@
|
||||
name: Publish Frontend on GitHub Pages
|
||||
name: Deploy frontend
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'crypto_clash_frontend/**'
|
||||
- '.github/workflows/deploy_frontend.yml'
|
||||
- 'config.json'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -14,8 +18,8 @@ concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
build:
|
||||
jobs:
|
||||
build-frontend:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
@@ -36,13 +40,14 @@ jobs:
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: ./crypto_clash_frontend/out
|
||||
deploy:
|
||||
deploy-frontend:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
needs:
|
||||
- build-frontend
|
||||
steps:
|
||||
- name: Publish to GitHub Pages
|
||||
id: deployment
|
||||
Reference in New Issue
Block a user