Skip to content

Deploy Production

Deploy Production #26

Workflow file for this run

name: Deploy Production
on:
workflow_dispatch:
inputs:
version:
type: string
default: ""
required: true
chart_version:
type: string
required: true
default: ""
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Checkout Code
uses: actions/checkout@v2
- id: auth
name: Authenticate to Google Cloud
uses: google-github-actions/auth@v1
with:
token_format: 'access_token'
workload_identity_provider: 'projects/${{ secrets.PROD_GKE_PROJECT_ID}}/locations/global/workloadIdentityPools/github/providers/github'
service_account: '${{ secrets.PROD_GKE_SA }}'
- name: Setup GCloud
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ secrets.PROD_GKE_PROJECT }}
install_components: 'gke-gcloud-auth-plugin'
- name: Login to GAR
uses: docker/login-action@v1
with:
registry: us-east1-docker.pkg.dev
username: oauth2accesstoken
password: '${{ steps.auth.outputs.access_token }}'
- name: Authenticate GHA Runner To Target Cluster
uses: google-github-actions/get-gke-credentials@v2
with:
cluster_name: ${{secrets.PROD_GKE_CLUSTER}}
location: ${{secrets.PROD_GKE_REGION}}
project_id: ${{secrets.PROD_GKE_PROJECT}}
- name: Set up yq
uses: frenck/action-setup-yq@v1
- name: Deploy Production
run: |
helm upgrade -i llm "oci://us-east1-docker.pkg.dev/${{ secrets.PROD_GKE_PROJECT}}/containers/sefaria-llm/chart/sefaria-llm" \
--version ${{ inputs.chart_version }} \
--set deployment.image.tag="${{ inputs.version }}" \
--set deployment.image.registry="us-east1-docker.pkg.dev/${{ secrets.PROD_GKE_PROJECT }}/containers" \
-f deploy/env/prod/values.yaml