Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions .github/workflows/mono-engine-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,21 @@ on:
- '.github/workflows/web-test.yml'
- '.github/workflows/web-deploy.yml'

env:
AWS_ECS_CLUSTER_NAME: ${{ secrets.AWS_ECS_CLUSTER_NAME }}
AWS_ECS_MONO_SERVICE_NAME: ${{ secrets.AWS_ECS_MONO_SERVICE_NAME }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy-mono:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
Expand All @@ -49,4 +55,15 @@ jobs:
IMAGE_TAG: mono-0.1.0-pre-release
run: |
docker buildx build -t $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG -f ./docker/mono-engine-dockerfile .
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG

- name: Force ECS redeploy
run: |
aws ecs update-service \
--cluster ${{ secrets.AWS_ECS_CLUSTER_NAME }} \
--service ${{ secrets.AWS_ECS_MONO_SERVICE_NAME }} \
--force-new-deployment
env:
AWS_REGION: ap-southeast-2
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
17 changes: 17 additions & 0 deletions .github/workflows/web-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ on:

env:
TIPTAP_PRIVATE_REGISTRY_KEY: ${{ secrets.TIPTAP_PRIVATE_REGISTRY_KEY }}
AWS_ECS_CLUSTER_NAME: ${{ secrets.AWS_ECS_CLUSTER_NAME }}
AWS_ECS_WEB_SERVICE_NAME: ${{ secrets.AWS_ECS_WEB_SERVICE_NAME }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
web-ui-deploy:
Expand Down Expand Up @@ -81,3 +87,14 @@ jobs:
docker build \
-t $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG .
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG

- name: Force ECS redeploy
run: |
aws ecs update-service \
--cluster ${{ secrets.AWS_ECS_CLUSTER_NAME }} \
--service ${{ secrets.AWS_ECS_WEB_SERVICE_NAME }} \
--force-new-deployment
env:
AWS_REGION: ap-southeast-2
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
3 changes: 0 additions & 3 deletions .github/workflows/web-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.base.ref }}

- uses: actions/setup-node@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions moon/apps/web/components/CodeView/TreeView/RepoTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ const RepoTree = ({ directory }:any) => {
if (node.path && node.path !== '' && node.path !== undefined) {
responseData = await fetch(`/api/tree?path=${node.path}`)
.then(response => response.json())
.catch(e => {
.catch(_ => {
throw new Error('Failed to fetch tree data');
})
} else {
responseData = await fetch(`/api/tree?path=${reqPath}`)
.then(response => response.json())
.catch(e => {
.catch(_ => {
throw new Error('Failed to fetch tree data');
})
}
Expand Down