diff --git a/.dockerignore b/.dockerignore index 6054ff4c2..c5935792a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -18,3 +18,5 @@ src/generated/node_modules src/generated/plugin/node_modules src/design-system/node_modules +src/apps/devdoc/node_modules +src/apps/devdoc/.next diff --git a/.github/workflows/build-container.yaml b/.github/workflows/build-container.yaml index cdeeb43f3..093041dda 100644 --- a/.github/workflows/build-container.yaml +++ b/.github/workflows/build-container.yaml @@ -21,6 +21,14 @@ jobs: app: - auth - console + - website + include: + - app: auth + dockerFile: Dockerfile + - app: console + dockerFile: Dockerfile + - app: website + dockerFile: Dockerfile.website runs-on: ubuntu-latest name: Deploy to Docker Image steps: @@ -47,5 +55,5 @@ jobs: branch_name=${GITHUB_REF#refs/heads/} version_string="v${branch_name#release-}-nightly" - docker build --build-arg APP=${{matrix.app}} . -t ghcr.io/kloudlite/platform/web/${{matrix.app}}:$version_string --push - docker build --build-arg APP=${{matrix.app}} . -t ghcr.io/kloudlite/platform/web/${{matrix.app}}:commit-${GITHUB_SHA} --push \ No newline at end of file + docker build --build-arg APP=${{matrix.app}} -f ${{matrix.dockerFile}} . -t ghcr.io/kloudlite/platform/web/${{matrix.app}}:$version_string --push + docker build --build-arg APP=${{matrix.app}} -f ${{matrix.dockerFile}} . -t ghcr.io/kloudlite/platform/web/${{matrix.app}}:commit-${GITHUB_SHA} --push \ No newline at end of file diff --git a/Dockerfile.website b/Dockerfile.website new file mode 100644 index 000000000..5f67f8eec --- /dev/null +++ b/Dockerfile.website @@ -0,0 +1,17 @@ +FROM node:20.8.1-alpine as node +WORKDIR /app + +COPY ./src/apps/devdoc ./src/apps/devdoc +COPY ./src/design-system/tailwind-base.js ./src/design-system/tailwind-base.js +COPY ./src/design-system/css-plugins ./src/design-system/css-plugins +COPY ./src/design-system/css ./src/design-system/css +COPY ./src/design-system/out ./src/design-system/out + +WORKDIR /app/src/apps/devdoc + +RUN npm i -g pnpm +RUN pnpm i -p + +RUN npm run build + +ENTRYPOINT pnpm start \ No newline at end of file diff --git a/Taskfile.yaml b/Taskfile.yaml index b0fb795b8..ba62b354c 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -35,7 +35,7 @@ tasks: case $(whoami) in "bikash") - URL_SUFFIX=1 + URL_SUFFIX="" ;; "vision") @@ -170,3 +170,12 @@ tasks: - docker push {{.IMAGE}}/auth:{{.tag}} - docker build --build-arg APP=console . -t {{.IMAGE}}/console:{{.tag}} - docker push {{.IMAGE}}/console:{{.tag}} + + docker-build-website: + preconditions: + - sh: '[[ -n "{{.tag}}" ]]' + msg: "var tag must have a value" + silent: false + cmds: + # - cd ./src/design-system && mkdir -p out && pnpm local:release + - docker buildx build . -t {{.tag}} -f Dockerfile.website diff --git a/src/design-system/package.json b/src/design-system/package.json index 54a692234..7906afb65 100644 --- a/src/design-system/package.json +++ b/src/design-system/package.json @@ -8,7 +8,7 @@ "author": "", "license": "ISC", "scripts": { - "local:release": "npm run build:css && npm run build && node prod-package.js && cd dist && npm pack --pack-destination ../out", + "local:release": "mkdir -p out && npm run build:css && npm run build && node prod-package.js && cd dist && npm pack --pack-destination ../out", "build": "npm run clean && node build.js && npm run tsc", "clean": "rimraf dist", "tsc": "tsc --emitDeclarationOnly --outDir ./dist/",