Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/optimism-java/disput…
Browse files Browse the repository at this point in the history
…e-explorer-frontend into development
  • Loading branch information
lance10030 committed Jul 30, 2024
2 parents 53c4249 + 8f1bd59 commit e13fd34
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 3 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build Docker images

on:
push:
branches:
- "development"
pull_request:
branches:
- "development"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Create .env file
run: |
echo "NEXT_PUBLIC_API_KEY=${{ secrets.NEXT_PUBLIC_API_KEY }}" > .env
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM node:20.16.0-alpine AS deps
RUN apk update && apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN npm install -g pnpm && pnpm install

FROM node:20.16.0-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm install -g pnpm && pnpm build && pnpm install --production

FROM node:20.16.0-alpine
WORKDIR /app
ENV NEXT_TELEMETRY_DISABLED 1
ENV NODE_ENV production

COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
EXPOSE 3000
ENV PORT 3000

CMD ["node_modules/.bin/next", "start"]
2 changes: 1 addition & 1 deletion src/components/Cards/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const CardHeader: FC<CardHeaderProps> = function ({
export type CardFieldProps = {
name: ReactNode;
value: ReactNode;
originValue: string;
originValue?: string;
};

export const CardField: FC<CardFieldProps> = function ({
Expand Down
2 changes: 0 additions & 2 deletions src/components/Cards/SurfaceCards/GameCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { shortenAddress } from "@/utils";
import shield from "@/icons/shield.png";
import sword from "@/icons/sword.png";
import Image from "next/image";
import { useRouter } from "next/router";

type GameCardProps = {
game: Game;
Expand All @@ -19,7 +18,6 @@ type GameCardProps = {
const GameCard: FC<Partial<GameCardProps>> = function ({
game: { l2_block_number: number, block_time, game_contract, status } = {},
}) {
const nav = useRouter();

return (
<SurfaceCardBase>
Expand Down

0 comments on commit e13fd34

Please sign in to comment.