Skip to content

Commit d5276d3

Browse files
committed
added backend test github actions
1 parent d00aaf4 commit d5276d3

File tree

2 files changed

+110
-0
lines changed

2 files changed

+110
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Build and Deploy to Cloud Run
2+
3+
#on:
4+
# push:
5+
# branches: [ "master" ]
6+
7+
on:
8+
workflow_dispatch:
9+
10+
env:
11+
SERVICE: api-based-hardware
12+
REGION: us-central1
13+
14+
jobs:
15+
deploy:
16+
environment: prod
17+
permissions:
18+
contents: 'read'
19+
id-token: 'write'
20+
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v2
25+
26+
- name: Google Auth
27+
id: auth
28+
uses: 'google-github-actions/auth@v0'
29+
with:
30+
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
31+
- run: gcloud auth configure-docker
32+
- name: Build and Push Docker image
33+
run: |
34+
docker build -t gcr.io/${{ vars.GCP_PROJECT_ID }}/${{ env.SERVICE }} .
35+
docker push gcr.io/${{ vars.GCP_PROJECT_ID }}/${{ env.SERVICE }}
36+
37+
- name: Deploy to Cloud Run
38+
id: deploy
39+
uses: google-github-actions/deploy-cloudrun@v0
40+
with:
41+
service: ${{ env.SERVICE }}
42+
region: ${{ env.REGION }}
43+
image: gcr.io/${{ vars.GCP_PROJECT_ID }}/${{ env.SERVICE }}
44+
45+
# If required, use the Cloud Run url output in later steps
46+
- name: Show Output
47+
run: echo ${{ steps.deploy.outputs.url }}
48+
upload_image: # for instances
49+
environment: prod
50+
permissions:
51+
contents: 'read'
52+
id-token: 'write'
53+
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: Checkout
57+
uses: actions/checkout@v2
58+
59+
- name: Google Auth
60+
id: auth
61+
uses: 'google-github-actions/auth@v0'
62+
with:
63+
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
64+
- run: gcloud auth configure-docker
65+
- name: Build and Push Docker image
66+
run: |
67+
docker build -t gcr.io/${{ vars.GCP_PROJECT_ID }}/whisper-x Dockerfile2
68+
docker push gcr.io/${{ vars.GCP_PROJECT_ID }}/whisper-x Dockerfile2
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Push to Replicate
2+
3+
on:
4+
# push:
5+
# branches: [ "master" ]
6+
workflow_dispatch:
7+
# inputs:
8+
# model_name:
9+
# required: true
10+
# description: "basedhardware/speechbrain-vad"
11+
12+
jobs:
13+
create-runner:
14+
environment: prod
15+
runs-on: ubuntu-latest
16+
outputs:
17+
label: ${{ steps.create-runner.outputs.label }}
18+
steps:
19+
- id: create-runner
20+
uses: related-sciences/[email protected]
21+
with:
22+
token: ${{ secrets.GH_SA_TOKEN }}
23+
project_id: ${{ secrets.GCP_PROJECT_ID }}
24+
service_account_key: ${{ secrets.GCP_CREDENTIALS }}
25+
image_project: ubuntu-os-cloud
26+
image_family: ubuntu-2004-lts
27+
build:
28+
environment: prod
29+
needs: create-runner
30+
runs-on: ${{ needs.create-runner.outputs.label }}
31+
steps:
32+
- name: Check out code
33+
uses: actions/checkout@v3
34+
35+
- name: Setup Cog
36+
uses: replicate/setup-cog@v2
37+
with:
38+
token: ${{ secrets.REPLICATE_API_TOKEN }}
39+
40+
- name: Push to Replicate
41+
run: |
42+
cd replicate/vad/; cog push r8.im/basedhardware/speechbrain-vad

0 commit comments

Comments
 (0)