-
Notifications
You must be signed in to change notification settings - Fork 3
61 lines (53 loc) · 1.79 KB
/
build_and_deploy.yaml
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
name: Build Docker Image, Push to GHCR and Deploy to GKE
on:
push:
branches:
- main
- feat/deployment
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
ghcr.io/developmentseed/llllm:latest
ghcr.io/developmentseed/llllm:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
- name: Configure kubectl
run: |
gcloud components install gke-gcloud-auth-plugin
gcloud config set project ${{ secrets.PROJECT_ID }}
gcloud config set compute/zone us-central1-f
gcloud container clusters get-credentials ${{ secrets.CLUSTER_NAME }}
- name: 'Set up Helm'
uses: 'Azure/setup-helm@v1'
with:
version: 'v3.12.0'
- name: "Deploy Helm Chart"
run: |
helm upgrade --install project-llllm deployment/helm --create-namespace --namespace project-llllm \
--set secrets.openai_api_key=${{ secrets.OPENAI_API_KEY }} \
--set streamlit.image.tag=${{ github.sha }}
- name: Create contacts configmap
run: kubectl apply -f deployment/k8s/configmap.yaml --namespace project-llllm