diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 0f774a3..5b12dc9 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -12,7 +12,6 @@ env: IMAGE_NAME: ethrex_l2_hub jobs: - # This pushes the image to GitHub Packages. push: runs-on: ubuntu-latest @@ -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 diff --git a/app/Dockerfile b/app/Dockerfile index 2233bd5..b48acfa 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -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 diff --git a/app/src/components/Deposit/Deposit.tsx b/app/src/components/Deposit/Deposit.tsx index 4f08311..d05f99d 100644 --- a/app/src/components/Deposit/Deposit.tsx +++ b/app/src/components/Deposit/Deposit.tsx @@ -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("");