Skip to content

Commit

Permalink
Merge pull request #52 from refly-ai/chore/monorepo-github-actions
Browse files Browse the repository at this point in the history
chore: adjust github actions for monorepo
  • Loading branch information
mrcfps authored Jun 4, 2024
2 parents f0f9310 + b865741 commit a1448eb
Show file tree
Hide file tree
Showing 47 changed files with 524 additions and 2,302 deletions.
5 changes: 1 addition & 4 deletions .aws/ecs-task-definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@
"secretOptions": []
},
"healthCheck": {
"command": [
"CMD-SHELL",
"curl -f http://localhost:3000 >> /proc/1/fd/1 2>&1 || exit 1"
],
"command": ["CMD-SHELL", "curl -sSf http://localhost:3000 >> /proc/1/fd/1 2>&1 || exit 1"],
"interval": 30,
"timeout": 10,
"retries": 3,
Expand Down
11 changes: 11 additions & 0 deletions apps/api/.dockerignore → .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
.git
.gitignore
.dockerignore
.github
.vscode

# Rush temp files
common/deploy/
common/temp/
common/autoinstallers/*/.npmrc
**/.rush/temp/
*.lock
*.log
*.chunks.jsonl

# Build dependencies
dist
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/deploy-api-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: refly-ai
SENTRY_PROJECT: reflyd
with:
environment: ${{ inputs.environment }}

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
Expand All @@ -55,7 +46,7 @@ jobs:
env:
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $ECR_REPOSITORY:$IMAGE_TAG apps/api
docker build -t $ECR_REPOSITORY:$IMAGE_TAG -f apps/api/Dockerfile .
docker push $ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
Expand All @@ -75,3 +66,12 @@ jobs:
service: ${{ inputs.ecs-service }}
cluster: ${{ inputs.ecs-cluster }}
wait-for-service-stability: true

- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: refly-ai
SENTRY_PROJECT: reflyd
with:
environment: ${{ inputs.environment }}
10 changes: 5 additions & 5 deletions .github/workflows/deploy-api-prod.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Deploy API To Prod

on:
# push:
# branches:
# - release
# paths:
# - 'apps/api/**'
push:
branches:
- release
paths:
- 'apps/api/**'
workflow_dispatch:

jobs:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/deploy-api-staging.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Deploy API To Staging

on:
# push:
# branches-ignore:
# - release
# paths:
# - 'apps/api/**'
push:
branches-ignore:
- release
paths:
- 'apps/api/**'
workflow_dispatch:

jobs:
Expand Down
29 changes: 19 additions & 10 deletions .github/workflows/deploy-web-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: refly-ai
SENTRY_PROJECT: web
- uses: pnpm/action-setup@v2
with:
environment: ${{ inputs.environment }}
version: 8

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'pnpm'

- name: Build
run: pnpm install && pnpm --filter '@refly/web' build
- name: Set cache env
uses: gigara/rush-cache@v2

- name: Rush Install
run: node common/scripts/install-run-rush.js install

- name: Rush Build
run: node common/scripts/install-run-rush.js build

- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
Expand All @@ -47,3 +47,12 @@ jobs:
branch: main # always main, to ensure production deployment
workingDirectory: apps/web
directory: dist

- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: refly-ai
SENTRY_PROJECT: web
with:
environment: ${{ inputs.environment }}
10 changes: 5 additions & 5 deletions .github/workflows/deploy-web-prod.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Deploy Web To Prod

on:
# push:
# branches:
# - release
# paths:
# - 'apps/web/**'
push:
branches:
- release
paths:
- 'apps/web/**'
workflow_dispatch:

jobs:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/deploy-web-staging.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Deploy Web To Staging

on:
# push:
# branches-ignore:
# - release
# paths:
# - 'apps/web/**'
push:
branches-ignore:
- release
paths:
- 'apps/web/**'
workflow_dispatch:

jobs:
Expand Down
176 changes: 0 additions & 176 deletions aero/.gitignore

This file was deleted.

Empty file removed aero/Makefile
Empty file.
34 changes: 0 additions & 34 deletions aero/aero_pb2.py

This file was deleted.

Loading

0 comments on commit a1448eb

Please sign in to comment.