From c156fc92b5a0a36d003ae3d177e5ccc58ae85ad3 Mon Sep 17 00:00:00 2001 From: Kevin Ingersoll Date: Tue, 5 Sep 2023 13:37:15 +0100 Subject: [PATCH] try publishing two targets --- .github/workflows/docker.yml | 13 ++++++++++--- Dockerfile | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7b69bddbbd..0d64923fe1 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -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 @@ -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 @@ -39,6 +46,6 @@ jobs: with: context: . push: true - target: builder + target: ${{ matrix.target }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index 4b70e95527..6b4a5ef2c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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