Skip to content

Commit

Permalink
chore: updated workflows and add firebase deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
Goldziher committed Nov 28, 2023
1 parent 73be292 commit 3607c2b
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 43 deletions.
File renamed without changes.
60 changes: 60 additions & 0 deletions .github/workflows/deploy-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Deploy (Frontend)
on:
pull_request:
branches:
- main
# paths:
# - 'frontend/src/**'
# - 'shared/ts/**'
push:
branches:
- main
paths:
- 'frontend/src/**'
- 'shared/ts/**'

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 21
- name: Install PNPM
uses: pnpm/[email protected]
id: pnpm-install
with:
version: 8
run_install: false
- name: Setup PNPM Cache
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Load Cached Dependencies
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install Node dependencies
run: pnpm install -r
- name: build
run: pnpm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
if: github.event_name != 'pull_request'
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_BASEMIND_AI_DEVELOPMENT }}'
channelId: live
projectId: basemind-ai-development
- uses: FirebaseExtended/action-hosting-deploy@v0
if: github.event_name == 'pull_request'
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_BASEMIND_AI_DEVELOPMENT }}'
projectId: basemind-ai-development
7 changes: 5 additions & 2 deletions .github/workflows/tests-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ on:
push:
branches:
- main
paths:
- '*.gradle.kts'
- 'gradle.properties'
- 'gradle/**'
- 'sdks/android/**'
pull_request:
branches:
- main
Expand All @@ -22,8 +27,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Java
uses: actions/setup-java@v3
with:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/tests-go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ on:
push:
branches:
- main
paths:
- 'gen/go/**'
- 'go.*'
- 'services/api-gateway/**'
- 'services/dashboard-backend/**'
- 'shared/go/**'
pull_request:
branches:
- main
Expand All @@ -29,8 +35,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Golang
uses: actions/setup-go@v4
with:
Expand Down
35 changes: 24 additions & 11 deletions .github/workflows/tests-ts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ on:
push:
branches:
- main
paths:
- 'frontend/**'
- 'gen/ts/**'
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- 'services/openai-connector/**'
- 'services/cohere-connector/**'
- 'shared/ts/**'
- 'tsconfig.json'
- 'vitest.*'
pull_request:
branches:
- main
Expand All @@ -29,30 +40,32 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 21
- name: Download the DeepSource CLI
run: curl https://deepsource.io/cli | sh
- name: Install pnpm
- name: Install PNPM
uses: pnpm/[email protected]
id: pnpm-install
with:
version: 8
- name: Setup pnpm cache
run_install: false
- name: Setup PNPM Cache
id: pnpm-cache
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Load cached Node dependencies
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Load Cached Dependencies
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-store-
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install Node dependencies
run: pnpm install -r
- name: Download the DeepSource CLI
run: curl https://deepsource.io/cli | sh
- name: Test
run: pnpm run test:coverage
- name: Upload Coverage Report
Expand Down
52 changes: 28 additions & 24 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,37 @@ jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 21
- name: Install PNPM
uses: pnpm/[email protected]
id: pnpm-install
with:
version: 8
run_install: false
- name: Setup PNPM Cache
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Load Cached Node Dependencies
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install Node dependencies
run: pnpm install -r
- name: Setup Golang
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Load cached Golang dependencies
- name: Load Cached Golang Dependencies
id: cached-go-dependencies
uses: actions/cache@v3
with:
Expand All @@ -24,36 +49,15 @@ jobs:
~/go/pkg/mod
key: go-${{ inputs.go_version }}-v1.0-${{ hashFiles('**/go.sum') }}
- name: Install Golang dependencies
if: steps.cached-go-dependencies.outputs.cache-hit != 'true'
shell: bash
run: go get -v -t ./...
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 21
- name: Install pnpm
uses: pnpm/[email protected]
id: pnpm-install
with:
version: 8
- name: Setup pnpm cache
id: pnpm-cache
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Load cached Node dependencies
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-store-
- name: Install Node dependencies
run: pnpm install -r
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Pre-Commit
run: python -m pip install pre-commit && pre-commit install
- name: Load cached Pre-Commit Dependencies
- name: Load Cached Pre-Commit Dependencies
id: cached-pre-commit-dependencies
uses: actions/cache@v3
with:
Expand Down
21 changes: 19 additions & 2 deletions .idea/dataSources.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/firebase.json → firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"region": "europe-west1"
},
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"source": "."
"source": "frontend"
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"private": true,
"scripts": {
"test:coverage": "vitest run --coverage",
"test": "vitest"
"test": "vitest",
"build:frontend": "cd frontend && pnpm run build && cd .."
},
"devDependencies": {
"@bufbuild/buf": "^1.28.1",
Expand Down

0 comments on commit 3607c2b

Please sign in to comment.