From 84eefc0fe3b84012f9b024658be778bb41bcc375 Mon Sep 17 00:00:00 2001 From: Krishan Patel Date: Mon, 2 Nov 2026 20:30:22 +0000 Subject: [PATCH 1/3] Fiddle: remove the docs docker image (docs are served from the site hosting bucket) --- docs.Dockerfile | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 docs.Dockerfile diff --git a/docs.Dockerfile b/docs.Dockerfile deleted file mode 100644 index 3a00d090..00000000 --- a/docs.Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# Stage 1: build -FROM node:24.22.0 AS build - -WORKDIR /app -COPY makefile . - -# Install requirements -COPY package.json . -COPY package-lock.json . -RUN make install - -# Build app -COPY . . -RUN make build-docs - -# Stage 2: Serve build files with nginx -FROM ghcr.io/kibalabs/app-serve:latest -COPY --from=build /app/dist /usr/share/nginx/html From 799d7e07e986a329bb21c60dcd697637b937a4a5 Mon Sep 17 00:00:00 2001 From: Krishan Patel Date: Mon, 2 Nov 2026 20:30:41 +0000 Subject: [PATCH 2/3] Revert "Fiddle: remove the docs docker image (docs are served from the site hosting bucket)" This reverts commit 84eefc0fe3b84012f9b024658be778bb41bcc375. --- docs.Dockerfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 docs.Dockerfile diff --git a/docs.Dockerfile b/docs.Dockerfile new file mode 100644 index 00000000..3a00d090 --- /dev/null +++ b/docs.Dockerfile @@ -0,0 +1,18 @@ +# Stage 1: build +FROM node:24.22.0 AS build + +WORKDIR /app +COPY makefile . + +# Install requirements +COPY package.json . +COPY package-lock.json . +RUN make install + +# Build app +COPY . . +RUN make build-docs + +# Stage 2: Serve build files with nginx +FROM ghcr.io/kibalabs/app-serve:latest +COPY --from=build /app/dist /usr/share/nginx/html From 6f6daf3ef7467aeae5b6a17a6e645e9e48826440 Mon Sep 17 00:00:00 2001 From: Krishan Patel Date: Mon, 2 Nov 2026 20:53:33 +0000 Subject: [PATCH 3/3] Deploy docs to the site hosting bucket instead of the app box --- .github/workflows/deploy-docs.yml | 122 +++++------------------------- 1 file changed, 18 insertions(+), 104 deletions(-) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 11192b6f..d0c91918 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -8,115 +8,29 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }}-deploy-docs cancel-in-progress: false jobs: - deploy-docs-next: - runs-on: ubuntu-latest - env: - DOCKER_IMAGE: ghcr.io/${{ github.repository }}-docs:next - steps: - - name: Check out the repo - uses: actions/checkout@v7 - - name: Login to GitHub container registry - uses: docker/login-action@v4 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v4 - - name: Build docker image - uses: docker/build-push-action@v7 - with: - context: . - push: true - cache-from: type=gha,scope=docs-app - cache-to: type=gha,mode=max,scope=docs-app - tags: ${{ env.DOCKER_IMAGE }} - file: ./docs.Dockerfile - run-docs-next: - needs: deploy-docs-next - runs-on: ubuntu-latest - env: - NAME: ui-react-docs-next - DOCKER_IMAGE: ghcr.io/${{ github.repository }}-docs:next - steps: - - name: executing remote ssh commands - uses: appleboy/ssh-action@master - with: - host: ${{ secrets.KIBA_APP_BOX_URL }} - username: ${{ secrets.KIBA_APP_BOX_USER }} - key: ${{ secrets.KIBA_APP_BOX_SSH_KEY }} - port: ${{ secrets.KIBA_APP_BOX_PORT }} - envs: DOCKER_IMAGE,NAME - script_stop: true - script: | - url="ui-react-docs-next.kibalabs.com" - varsFile=~/.${NAME}.vars - docker pull ${DOCKER_IMAGE} - docker stop ${NAME} && docker rm ${NAME} || true - docker run \ - --name ${NAME} \ - --detach \ - --publish-all \ - --restart on-failure \ - --env NAME=${NAME} \ - --env VIRTUAL_HOST=${url} \ - --env LETSENCRYPT_HOST=${url} \ - --env-file ${varsFile} \ - ${DOCKER_IMAGE} deploy-docs: - if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest env: - DOCKER_IMAGE: ghcr.io/${{ github.repository }}-docs:latest + DOMAIN_NAME: ${{ startsWith(github.ref, 'refs/tags/v') && 'ui-react-docs.kibalabs.com' || 'ui-react-docs-next.kibalabs.com' }} steps: - name: Check out the repo uses: actions/checkout@v7 - - name: Login to GitHub container registry - uses: docker/login-action@v4 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v4 - - name: Build docker image - uses: docker/build-push-action@v7 + - name: Set up node + uses: actions/setup-node@v7 with: - context: . - push: true - cache-from: type=gha,scope=docs-app - cache-to: type=gha,mode=max,scope=docs-app - tags: ${{ env.DOCKER_IMAGE }} - file: ./docs.Dockerfile - run-docs: - needs: deploy-docs - if: startsWith(github.ref, 'refs/tags/v') - runs-on: ubuntu-latest - env: - NAME: ui-react-docs - DOCKER_IMAGE: ghcr.io/${{ github.repository }}-docs:latest - steps: - - name: executing remote ssh commands - uses: appleboy/ssh-action@master + node-version: '24' + cache: npm + - name: Install dependencies + run: make install + - name: Build docs + run: make build-docs + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v6 with: - host: ${{ secrets.KIBA_APP_BOX_URL }} - username: ${{ secrets.KIBA_APP_BOX_USER }} - key: ${{ secrets.KIBA_APP_BOX_SSH_KEY }} - port: ${{ secrets.KIBA_APP_BOX_PORT }} - envs: DOCKER_IMAGE,NAME - script_stop: true - script: | - url="ui-react-docs.kibalabs.com" - varsFile=~/.${NAME}.vars - docker pull ${DOCKER_IMAGE} - docker stop ${NAME} && docker rm ${NAME} || true - docker run \ - --name ${NAME} \ - --detach \ - --publish-all \ - --restart on-failure \ - --env NAME=${NAME} \ - --env VIRTUAL_HOST=${url} \ - --env LETSENCRYPT_HOST=${url} \ - --env-file ${varsFile} \ - ${DOCKER_IMAGE} + aws-access-key-id: ${{ secrets.SITE_DEPLOYER_AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.SITE_DEPLOYER_AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.SITE_DEPLOYER_AWS_REGION }} + - name: Sync to S3 + run: aws s3 sync ./dist s3://${{ secrets.SITE_DEPLOYMENT_S3_BUCKET_NAME }}/${{ env.DOMAIN_NAME }}/ + - name: Invalidate CloudFront cache + run: aws cloudfront create-invalidation --distribution-id ${{ secrets.SITE_DEPLOYMENT_CLOUDFRONT_ID }} --paths "/${{ env.DOMAIN_NAME }}/*"