forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (62 loc) · 2.37 KB
/
desktop_backend_auto_dev.yml
File metadata and controls
74 lines (62 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Auto Deploy Desktop Backend to Development
on:
push:
branches: [ "main" ]
paths:
- 'desktop/Backend-Rust/**'
env:
SERVICE: desktop-backend
REGION: us-central1
jobs:
deploy:
environment: development
permissions:
contents: 'read'
id-token: 'write'
runs-on: ubuntu-latest-m
steps:
- name: Delete huge unnecessary tools folder
run: rm -rf /opt/hostedtoolcache
- name: Checkout
uses: actions/checkout@v4
- name: Google Auth
id: auth
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
- name: Login to GCR
run: gcloud auth configure-docker
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Google Service Account
run: echo "${{ secrets.GCP_SERVICE_ACCOUNT }}" | base64 -d > ./desktop/Backend-Rust/google-credentials.json
- name: Build and Push Docker image
uses: docker/build-push-action@v6
with:
context: ./desktop/Backend-Rust
file: ./desktop/Backend-Rust/Dockerfile
push: true
tags: gcr.io/${{ vars.GCP_PROJECT_ID }}/${{ env.SERVICE }}:latest
cache-from: type=registry,ref=gcr.io/${{ vars.GCP_PROJECT_ID }}/${{ env.SERVICE }}:buildcache
cache-to: type=registry,ref=gcr.io/${{ vars.GCP_PROJECT_ID }}/${{ env.SERVICE }}:buildcache,mode=max
- name: Deploy desktop-backend to Cloud Run
uses: google-github-actions/deploy-cloudrun@v2
with:
service: ${{ env.SERVICE }}
region: ${{ env.REGION }}
image: gcr.io/${{ vars.GCP_PROJECT_ID }}/${{ env.SERVICE }}
flags: '--allow-unauthenticated'
env_vars: |
FIREBASE_PROJECT_ID=based-hardware
GOOGLE_APPLICATION_CREDENTIALS=/app/google-credentials.json
secrets: |
GEMINI_API_KEY=GEMINI_API_KEY:latest
ENCRYPTION_SECRET=ENCRYPTION_SECRET:latest
REDIS_DB_PASSWORD=REDIS_DB_PASSWORD:latest
FIREBASE_API_KEY=FIREBASE_API_KEY:latest
PINECONE_API_KEY=PINECONE_API_KEY:latest
REDIS_DB_HOST=REDIS_DB_HOST:latest
REDIS_DB_PORT=REDIS_DB_PORT:latest
PINECONE_HOST=PINECONE_HOST:latest
- name: Show Output
run: echo "Desktop backend deployed to development environment"