fix workflows #6
Workflow file for this run
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
name: Deploy Model Serving Cluster GKE | |
on: | |
push: | |
# branches: | |
# - "master" | |
permissions: | |
id-token: write | |
jobs: | |
Build-Docker-Image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and Push Lens Docker Image | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./lens | |
file: ./lens/Dockerfile | |
tags: anhtu293/lens-app:${GITHUB_SHA} | |
push: true | |
- name: Build and Push OCR Docker Image | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./ocr-app | |
file: ./ocr-app/Dockerfile | |
tags: anhtu293/ocr-app:${GITHUB_SHA} | |
push: true | |
- name: Build and Push Translation Docker Image | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./trans-app | |
file: ./trans-app/Dockerfile | |
tags: anhtu293/trans-app:${GITHUB_SHA} | |
push: true | |
Deploy-Model-Serving-Cluster: | |
runs-on: ubuntu-latest | |
needs: [Build-Docker-Image] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- id: "auth" | |
name: "Authenticate to Google Cloud" | |
uses: "google-github-actions/auth@f112390a2df9932162083945e46d439060d66ec2" # google-github-actions/auth@v2 | |
with: | |
workload_identity_provider: "${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}" | |
# Get the GKE credentials so we can deploy to the cluster | |
- name: "Set up GKE credentials" | |
uses: "google-github-actions/get-gke-credentials@6051de21ad50fbb1767bc93c11357a49082ad116" # google-github-actions/get-gke-credentials@v2 | |
with: | |
cluster_name: "${{ secrets.GKE_CLUSTER }}" | |
location: "${{ secrets.GKE_ZONE }}" | |
- name: Install Helm | |
run: | | |
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash | |
- name: Deploy Lens App | |
run: | | |
gcloud container clusters get-credentials $GKE_CLUSTER \ | |
--zone $GKE_ZONE \ | |
--project $GKE_PROJECT | |
cd deployments/model-serving | |
helm upgrade --install app ./lens --set lens_app.image.tag=${GITHUB_SHA} --set ocr_app.image.tag=${GITHUB_SHA} --set translation_app.image.tag=${GITHUB_SHA} --namespace model-serving |