forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (67 loc) · 2.81 KB
/
gcp_apps_js.yml
File metadata and controls
76 lines (67 loc) · 2.81 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
75
76
name: Deploy Apps-Js to Cloud RUN
on:
push:
branches: [ "main", "development" ]
paths:
- 'plugins/apps-js/**'
workflow_dispatch:
inputs:
environment:
description: 'Select the environment to deploy to'
required: true
default: 'development'
branch:
description: 'Branch to deploy from'
required: true
default: 'main'
env:
SERVICE: apps-js
REGION: us-central1
jobs:
deploy:
environment: ${{ (github.ref == 'refs/heads/development' && 'development') || (github.ref == 'refs/heads/main' && 'prod') }}
permissions:
contents: 'read'
id-token: 'write'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Google Auth
id: auth
uses: 'google-github-actions/auth@v2'
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
- run: gcloud auth configure-docker
- name: Build and Push Docker image
run: |
docker build \
--build-arg OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} \
--build-arg OPENROUTER_API_KEY=${{ secrets.OPENROUTER_API_KEY }} \
--build-arg UPSTASH_REDIS_HOST=${{ secrets.UPSTASH_REDIS_HOST }} \
--build-arg UPSTASH_REDIS_PASSWORD=${{ secrets.UPSTASH_REDIS_PASSWORD }} \
--build-arg UPSTASH_REDIS_PORT=${{ secrets.UPSTASH_REDIS_PORT }} \
--build-arg JWT_SECRET=${{ secrets.JWT_SECRET }} \
--build-arg GOOGLE_CLIENT_ID=${{ secrets.GOOGLE_CLIENT_ID }} \
--build-arg GOOGLE_CLIENT_SECRET=${{ secrets.GOOGLE_CLIENT_SECRET }} \
--build-arg GOOGLE_REDIRECT_URI=${{ secrets.GOOGLE_REDIRECT_URI }} \
--build-arg GOOGLE_CALLBACK_URL=${{ secrets.GOOGLE_CALLBACK_URL }} \
--build-arg BASE_URL=${{ secrets.BASE_URL }} \
--build-arg SUPABASE_URL=${{ secrets.SUPABASE_URL }} \
--build-arg SUPABASE_KEY=${{ secrets.SUPABASE_KEY }} \
--build-arg OMI_APP_ID=${{ secrets.OMI_APP_ID }} \
--build-arg OMI_APP_SECRET=${{ secrets.OMI_APP_SECRET }} \
--build-arg DECK_APP_ID=${{ secrets.DECK_APP_ID }} \
--build-arg DECK_APP_SECRET=${{ secrets.DECK_APP_SECRET }} \
--build-arg SLIDESGPT_API_KEY=${{ secrets.SLIDESGPT_API_KEY }} \
-t gcr.io/${{ vars.GCP_PROJECT_ID }}/${{ env.SERVICE }} -f plugins/apps-js/Dockerfile .
docker push gcr.io/${{ vars.GCP_PROJECT_ID }}/${{ env.SERVICE }}
- name: Deploy to Cloud Run
id: deploy
uses: google-github-actions/deploy-cloudrun@v2
with:
service: ${{ env.SERVICE }}
region: ${{ env.REGION }}
image: gcr.io/${{ vars.GCP_PROJECT_ID }}/${{ env.SERVICE }}
- name: Show Output
run: echo ${{ steps.deploy.outputs.url }}