Skip to content

Commit

Permalink
Build docker images for each app (#185)
Browse files Browse the repository at this point in the history
* Reorder imports

* Build both spotlight and doj-demo on main and stable

* Remove "deploy" call from Dockerfile.
Context: I don't recall why this is here, but we'll find out soon
  • Loading branch information
danielnaab authored Jun 14, 2024
1 parent 384a22c commit 94c791f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: 'Run tests'
name: 'Deploy'

on:
push:
branches:
- main
tags:
- stable
workflow_dispatch:

env:
Expand All @@ -18,7 +20,9 @@ jobs:
uses: actions/checkout@v3

- name: Build container image
run: docker build . --platform linux/amd64 --target doj-demo --tag ${REGISTRY}/doj-demo:${TAG_NAME}
run: |
docker build . --platform linux/amd64 --target app --build-arg APP_DIR=doj-demo --tag ${REGISTRY}/doj-demo:${TAG_NAME}
docker build . --platform linux/amd64 --target app --build-arg APP_DIR=spotlight --tag ${REGISTRY}/spotlight:${TAG_NAME}
- name: Log in to the Container registry
uses: docker/login-action@v2
Expand All @@ -28,7 +32,9 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to container registry
run: docker push ${REGISTRY}/doj-demo:${TAG_NAME}
run: |
docker push ${REGISTRY}/doj-demo:${TAG_NAME}
docker push ${REGISTRY}/spotlight:${TAG_NAME}
deploy:
runs-on: ubuntu-latest
Expand Down
11 changes: 5 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@ COPY . /usr/src/app
WORKDIR /usr/src/app
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm build
RUN pnpm deploy --filter=doj-demo --prod /app/doj-demo
#RUN pnpm deploy --filter=spotlight --prod /app/spotlight

FROM base AS doj-demo
FROM base AS app
ARG APP_DIR=doj-demo

LABEL org.opencontainers.image.description 10x-atj DOJ demo

COPY --from=build /app/doj-demo /app/doj-demo
COPY --from=build /usr/src/app/apps/doj-demo/dist /app/doj-demo/dist
WORKDIR /app/doj-demo
COPY --from=build /app/$APP_DIR /app/$APP_DIR
COPY --from=build /usr/src/app/apps/$APP_DIR/dist /app/$APP_DIR/dist
WORKDIR /app/$APP_DIR

ENV HOST=0.0.0.0
ENV PORT=4321
Expand Down
2 changes: 1 addition & 1 deletion packages/forms/src/response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
validatePattern,
} from '.';
import { type PromptAction } from './components';
import { type FormSession, updateSession, FormErrorMap } from './session';
import { type FormErrorMap, type FormSession, updateSession } from './session';

export type PromptResponse = {
action: PromptAction['type'];
Expand Down

0 comments on commit 94c791f

Please sign in to comment.