Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ env:
IMAGE_NAME: ethrex_l2_hub

jobs:
# This pushes the image to GitHub Packages.
push:
runs-on: ubuntu-latest

Expand All @@ -21,11 +20,21 @@ jobs:
contents: read
steps:
- uses: actions/checkout@v5

- uses: dtolnay/rust-toolchain@stable

- name: Install rex
run: cargo install --locked --git https://github.com/lambdaclass/rex.git --branch l2_hub

- name: Compile contracts
run: |
rex compile --contract-path contracts/src/Delegation.sol --remappings "@solady=https://github.com/Vectorized/solady"
rex compile --contract-path contracts/src/TestToken.sol --remappings "@openzeppelin=https://github.com/OpenZeppelin/openzeppelin-contracts.git"
mv solc_out/Delegation.abi solc_out/Delegation.json
mv solc_out/TestToken.abi solc_out/TestToken.json

- name: Build image
working-directory: ./app
# TODO: add step to compile the contracts using rex
run: docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"
run: docker build . --file app/Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
Expand Down
9 changes: 4 additions & 5 deletions app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
FROM node:22-alpine3.21 AS build

# Set the working directory inside the container
WORKDIR /usr/src/app
WORKDIR /usr/src

# Copy package.json and package-lock.json into the container
COPY package*.json ./
COPY . .

# node-gyp requires python3
RUN apk add --no-cache python3 make g++

WORKDIR /usr/src/app

# Install dependencies using npm
RUN npm install

# Copy the project files into the working directory
COPY . .

EXPOSE 5173

# Build and start the app
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/Deposit/Deposit.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState, useEffect } from "react";
import { parseEther } from "viem";
import { useAccount, useSwitchChain, useWaitForTransactionReceipt } from "wagmi";
import { useDeposit, useWatchDepositInitiated } from "../hooks/deposit";
import { useDeposit, useWatchDepositInitiated } from "../../hooks/deposit";

export const Deposit: React.FC = () => {
const [amount, setAmount] = useState<string>("");
Expand Down
Loading