Skip to content

Commit

Permalink
feat: merged next
Browse files Browse the repository at this point in the history
  • Loading branch information
chavda-bhavik committed Jul 12, 2024
2 parents f9cdff3 + ab45e14 commit 9d9ab3e
Show file tree
Hide file tree
Showing 42 changed files with 553 additions and 389 deletions.
58 changes: 26 additions & 32 deletions .github/workflows/build-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,49 +20,43 @@ jobs:
- uses: actions/checkout@v2
- name: Setup kernel for react native, increase watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

- uses: actions/setup-node@v2
with:
node-version: '20.13.1'

- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: 4.2.8

- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/[email protected]
env:
CI: false
with:
version: 8.9.0
run_install: true

- name: Build, tag, and push image to Github Container Registry
id: build-image

- name: Build & Tag Docker image
env:
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/api
IMAGE_TAG: ${{ github.sha }}
GH_ACTOR: implerhq
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin
docker build -t ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG -f apps/api/Dockerfile .
docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
# docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod
docker run --network=host --name api -dit --env NODE_ENV=test --env JWT_SECRET=impler --env COOKIE_DOMAIN=impler ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG
docker run --network=host appropriate/curl --retry 10 --retry-delay 5 --retry-connrefused http://localhost:3000/v1/health-check | grep 'ok'
- name: Run Docker container
env:
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/api
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
run: docker run --network=host --name api -dit --env NODE_ENV=test --env JWT_SECRET=impler --env COOKIE_DOMAIN=impler ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG

- name: Check application health
run: docker run --network=host appropriate/curl --retry 10 --retry-delay 5 --retry-connrefused http://localhost:3000/v1/health-check | grep 'ok'

# docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod
- name: Log in to GitHub Container Registry
env:
GH_ACTOR: implerhq
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
run: echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin

- name: Push Docker image
env:
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/api
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
# docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG
# echo "::set-output name=IMAGE::ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG"
echo "::set-output name=IMAGE::ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG"
65 changes: 34 additions & 31 deletions .github/workflows/build-embed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,45 +20,48 @@ jobs:
- uses: actions/checkout@v2
- name: Setup kernel for react native, increase watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

- uses: actions/setup-node@v2
with:
node-version: '20.13.1'

- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/[email protected]
env:
CI: false
with:
version: 8.9.0
run_install: true

- name: Build
run: pnpm run --filter @impler/embed build:prod

- name: Build, tag, and push image to Github Container Registry
id: build-image
- name: Build & Tag Docker image
env:
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/embed
IMAGE_TAG: ${{ github.sha }}
GH_ACTOR: implerhq
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin
docker build -t ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG -f libs/embed/Dockerfile .
docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod
- name: Run Docker container
env:
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/embed
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
run: docker run --network=host -dit ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG

docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
- name: Check application health
run: |
for i in {1..5}; do
if curl --output /dev/null --silent --head --fail http://localhost:4701/embed.umd.min.js; then
exit 0
fi
echo "Waiting for the application to start..."
sleep 5
done
echo "Application failed to start"
exit 1
- name: Log in to GitHub Container Registry
env:
GH_ACTOR: implerhq
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
run: echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin

- name: Push Docker image
env:
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/embed
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
echo "::set-output name=IMAGE::ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG"
45 changes: 16 additions & 29 deletions .github/workflows/build-queuemanager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,41 +20,28 @@ jobs:
- uses: actions/checkout@v2
- name: Setup kernel for react native, increase watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

- uses: actions/setup-node@v2
with:
node-version: '20.13.1'

- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-

- uses: pnpm/[email protected]
env:
CI: false
with:
version: 8.9.0
run_install: true

- name: Build, tag, and push image to Github Container Registry
id: build-image
- name: Build & Tag Docker image
env:
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/queue-manager
IMAGE_TAG: ${{ github.sha }}
GH_ACTOR: implerhq
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin
docker build -t ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG -f apps/queue-manager/Dockerfile .
docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
- name: Log in to GitHub Container Registry
env:
GH_ACTOR: implerhq
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
run: echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin

- name: Push Docker image
env:
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/queue-manager
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
echo "::set-output name=IMAGE::ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG"
59 changes: 33 additions & 26 deletions .github/workflows/build-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,39 +21,46 @@ jobs:
- name: Setup kernel for react native, increase watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

- uses: actions/setup-node@v2
with:
node-version: '20.13.1'

- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/[email protected]
- name: Build & Tag Docker image
env:
CI: false
with:
version: 8.9.0
run_install: true

- name: Build, tag, and push image to Github container registry
id: build-image
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/web
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
docker build -t ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG -f apps/web/Dockerfile .
docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
- name: Run Docker container
env:
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/web
IMAGE_TAG: ${{ github.sha }}
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
run: docker run --network=host -dit ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG

- name: Check application health
run: |
for i in {1..5}; do
if curl --output /dev/null --silent --head --fail http://localhost:4200; then
exit 0
fi
echo "Waiting for the application to start..."
sleep 5
done
echo "Application failed to start"
exit 1
- name: Log in to GitHub Container Registry
env:
GH_ACTOR: implerhq
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
run: echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin

- name: Push Docker image
env:
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/web
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin
docker build -t ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG -f apps/web/Dockerfile .
docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod
docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG
echo "::set-output name=IMAGE::ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG"
65 changes: 36 additions & 29 deletions .github/workflows/build-widget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,44 +20,51 @@ jobs:
- uses: actions/checkout@v2
- name: Setup kernel for react native, increase watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

- uses: actions/setup-node@v2
with:
node-version: '20.13.1'

- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/[email protected]
env:
CI: false
with:
version: 8.9.0
run_install: true

- name: Envsetup
- name: Envsetup
working-directory: apps/widget
run: npm run envsetup

- name: Build & Tag Docker image
env:
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/widget
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
docker build -t ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG -f apps/widget/Dockerfile .
docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
- name: Build, tag, and push image to Github container registry
id: build-image
- name: Run Docker container
env:
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/widget
IMAGE_TAG: ${{ github.sha }}
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
run: docker run --network=host -dit ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG

- name: Check application health
run: |
for i in {1..5}; do
if curl --output /dev/null --silent --head --fail http://localhost:3500; then
exit 0
fi
echo "Waiting for the application to start..."
sleep 5
done
echo "Application failed to start"
exit 1
- name: Log in to GitHub Container Registry
env:
GH_ACTOR: implerhq
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
run: echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin

- name: Push Docker image
env:
REGISTERY_OWNER: implerhq
DOCKER_NAME: impler/widget
IMAGE_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin
docker build -t ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG -f apps/widget/Dockerfile .
docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod
docker tag ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:prod
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG
docker push ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:latest
echo "::set-output name=IMAGE::ghcr.io/$REGISTERY_OWNER/$DOCKER_NAME:$IMAGE_TAG"
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Build

on:
push:
branches:
- next
workflow_dispatch
# push:
# branches:
# - next

jobs:
build:
Expand Down
Loading

0 comments on commit 9d9ab3e

Please sign in to comment.