Skip to content

Commit

Permalink
Merge branch 'master' into KS-20343-config-drawer
Browse files Browse the repository at this point in the history
# Conflicts:
#	examples/react/package-lock.json
  • Loading branch information
forgiveme committed Apr 24, 2024
2 parents 06c7cd7 + d1c3807 commit 02ab03a
Show file tree
Hide file tree
Showing 44 changed files with 798 additions and 387 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/deployqa-demo-components.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Deploy Compnents demo to ECR - QA

on:
workflow_dispatch:
push:
paths:
- "examples/react-klevu-ui/**"

env:
AWS_REGION: eu-west-1
ECR_REPOSITORY: klevu/headless-react-klevu-ui
ECS_SERVICE: klevu-headless-demo-srv
ECS_CLUSTER: klevu-docs

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
environment: production

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@13d241b293754004c80624b5567555c4a39ffbe3
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_QA }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_QA }}
aws-region: ${{ env.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@aaf69d68aa3fb14c1d5a6be9ac61fe15b48453a2

- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: latest
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f examples/react-klevu-ui/Dockerfile .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
aws ecs update-service --cluster "${ECS_CLUSTER}" --service "${ECS_SERVICE}" --force-new-deployment
34 changes: 34 additions & 0 deletions examples/react-klevu-ui/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM node:17-alpine

ENV NODE_ENV "development"

WORKDIR /app

COPY examples/react-klevu-ui/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

ADD examples/react-klevu-ui examples/react-klevu-ui
ADD packages/klevu-core packages/klevu-core
ADD packages/klevu-ui-react packages/klevu-ui-react
ADD packages/klevu-ui packages/klevu-ui

WORKDIR /app/packages/klevu-core
RUN npm install
RUN npm run build

WORKDIR /app/packages/klevu-ui
RUN npm install
RUN npm run build

WORKDIR /app/packages/klevu-ui-react
RUN npm install
RUN npm run build

WORKDIR /app/examples/react-klevu-ui
RUN npm install
RUN npm run build

# ENTRYPOINT ["/app/entrypoint.sh"]

EXPOSE 3002
CMD ["npm", "run", "serve"]
5 changes: 5 additions & 0 deletions examples/react-klevu-ui/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

npm rebuild esbuild

exec "$@"
5 changes: 5 additions & 0 deletions examples/react-klevu-ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
/>
<script type="module" src="./src/index.tsx"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- <script
type="text/javascript"
async=""
src="https://static.klaviyo.com/onsite/js/klaviyo.js?company_id=VKKgpW"
></script> -->
</head>
<body>
<div id="root"></div>
Expand Down
Loading

0 comments on commit 02ab03a

Please sign in to comment.