forked from e2b-dev/E2B
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (44 loc) · 1.33 KB
/
api-service.yml
File metadata and controls
54 lines (44 loc) · 1.33 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
name: API service
on:
push:
paths:
- 'api-service/**'
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
id-token: write
contents: read
env:
IMAGE_TAG: us-central1-docker.pkg.dev/${{ secrets.GCE_PROJECT }}/services/ai-api-service:latest
jobs:
release:
name: Build and release
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Service Account
uses: google-github-actions/auth@v1
with:
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.SERVICE_ACCOUNT_EMAIL }}
- name: Configure Docker
run: gcloud --quiet auth configure-docker us-central1-docker.pkg.dev
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and Push
uses: docker/build-push-action@v3
with:
context: ./api-service
push: true
tags: ${{ env.IMAGE_TAG }}
cache-from: type=gha,scope=ai-api-service
cache-to: type=gha,scope=ai-api-service
- name: Deploy
uses: google-github-actions/deploy-cloudrun@v1
with:
service: ai-api-service
image: ${{ env.IMAGE_TAG }}