forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8fe5ff
commit 7664515
Showing
4 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Deploy Backend to Cloud RUN | ||
|
||
# TODO: determine if changes to backend folder before pushing | ||
|
||
on: | ||
push: | ||
branches: [ "main", "development" ] | ||
paths: | ||
- 'plugins/example/**' | ||
|
||
env: | ||
SERVICE: backend | ||
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@v2 | ||
|
||
- name: Google Auth | ||
id: auth | ||
uses: 'google-github-actions/auth@v0' | ||
with: | ||
credentials_json: ${{ secrets.GCP_CREDENTIALS }} | ||
- run: gcloud auth configure-docker | ||
- name: Build and Push Docker image | ||
run: | | ||
docker build -t gcr.io/${{ vars.GCP_PROJECT_ID }}/${{ env.SERVICE }} -f plugins/example/Dockerfile . | ||
docker push gcr.io/${{ vars.GCP_PROJECT_ID }}/${{ env.SERVICE }} | ||
- name: Deploy to Cloud Run | ||
id: deploy | ||
uses: google-github-actions/deploy-cloudrun@v0 | ||
with: | ||
service: ${{ env.SERVICE }} | ||
region: ${{ env.REGION }} | ||
image: gcr.io/${{ vars.GCP_PROJECT_ID }}/${{ env.SERVICE }} | ||
|
||
# If required, use the Cloud Run url output in later steps | ||
- name: Show Output | ||
run: echo ${{ steps.deploy.outputs.url }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM tiangolo/uvicorn-gunicorn:python3.11 | ||
|
||
RUN apt-get update && apt-get install --no-install-recommends --no-install-suggests -y curl | ||
RUN apt-get install unzip | ||
RUN apt-get -y install python3 | ||
RUN apt-get -y install python3-pip | ||
RUN apt-get -y install git | ||
RUN apt-get -y install ffmpeg | ||
|
||
COPY plugins/example/requirements.txt /tmp/requirements.txt | ||
RUN pip install --no-cache-dir -r /tmp/requirements.txt | ||
|
||
COPY plugins/example/ /app | ||
|
||
EXPOSE 8080 | ||
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"] |