Skip to content

Commit

Permalink
feat: use ghcr lidofinance registry
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan-Feofanov committed Sep 24, 2024
1 parent c45148a commit 431ed93
Show file tree
Hide file tree
Showing 6 changed files with 213 additions and 294 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cache
node_modules
17 changes: 9 additions & 8 deletions .github/workflows/build_and_push_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: build and push image

on:
push:
branches:
- 'main'
tags:
- '*'

jobs:
docker:
Expand All @@ -18,16 +18,17 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
- name: Login to ghcr.io
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6.1.0
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: lidofinance/hardhat-node:latest
tags: ghcr.io/lidofinance/hardhat-node:${{ github.ref_name }}
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
# Want to help us make this template better? Share your feedback here: https://forms.gle/ybq9Krt8jtBL3iCk7

ARG NODE_VERSION=lts
ARG PNPM_VERSION=9.1.0
ARG PNPM_VERSION=9.11.0

FROM node:${NODE_VERSION}-alpine

# Use production node environment by default.
ENV NODE_ENV production
ENV NODE_ENV=production

# Install pnpm.
RUN --mount=type=cache,target=/root/.npm \
Expand All @@ -36,4 +36,4 @@ COPY . .
EXPOSE 8545

# Run the application.
CMD pnpm start
CMD ["pnpm", "start"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ To run the mainnet fork you have to set one of the following environment variabl
```bash
docker run -e INFURA_TOKEN=your_token -p 8545:8545 -it --rm lidofinance/hardhat-node:latest
```

```bash
docker run -e ALCHEMY_TOKEN=your_token -p 8545:8545 -it --rm lidofinance/hardhat-node:latest
```

```bash
docker run -e ETH_RPC_URL=your_url -p 8545:8545 -it --rm lidofinance/hardhat-node:latest
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"@nomicfoundation/hardhat-ethers": "^3.0.4",
"dotenv": "^16.3.1",
"ethers": "^6.7.1",
"hardhat": "^2.16.1"
"hardhat": "2.22.11"
}
}
Loading

0 comments on commit 431ed93

Please sign in to comment.