Skip to content

Commit

Permalink
try publishing two targets
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed Sep 5, 2023
1 parent 2d72203 commit c156fc9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@ env:
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
docker:
name: Build and push image
runs-on: ubuntu-latest-16-cores
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- image: ghcr.io/latticexyz/mud
target: mud
- image: ghcr.io/latticexyz/store-indexer
target: store-indexer
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -29,7 +36,7 @@ jobs:
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
images: ${{ matrix.image }}
types: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=branch
Expand All @@ -39,6 +46,6 @@ jobs:
with:
context: .
push: true
target: builder
target: ${{ matrix.target }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ ENV PNPM_HOME="/pnpm"
ENV PATH="${PATH}:${PNPM_HOME}"
RUN npm install pnpm --global && pnpm --version

FROM base AS builder
FROM base AS mud
COPY . /app
WORKDIR /app

RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run -r build

FROM builder AS store-indexer
FROM mud AS store-indexer
WORKDIR /app/packages/store-indexer
EXPOSE 3001

0 comments on commit c156fc9

Please sign in to comment.