Update onyx-pipeline-webserver.yaml #11
This file contains hidden or 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: CortexAI Chat Frontend | |
on: | |
push: | |
branches: | |
- dev | |
paths: | |
- 'web/**' | |
- '.github/workflows/onyx-pipeline-webserver.yaml' | |
env: | |
ACR_REPOSITORY: onyx-web-server | |
ACR_LOGIN_SERVER: ${{ secrets.ACR_LOGIN_SERVER }} | |
HELM_RELEASE: onyx | |
HELM_NAMESPACE: onyx | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Set IMAGE_TAG | |
run: echo "IMAGE_TAG=v1.${GITHUB_REF##*/}.${{ github.run_number }}" >> $GITHUB_ENV | |
- name: Log in to Azure Container Registry(ACR) | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ secrets.ACR_LOGIN_SERVER }} | |
username: ${{ secrets.ACR_USERNAME }} | |
password: ${{ secrets.ACR_PASSWORD }} | |
- name: Build & Push Docker Image | |
run: | | |
docker build -t $ACR_LOGIN_SERVER/$ACR_REPOSITORY:$IMAGE_TAG -t $ACR_LOGIN_SERVER/$ACR_REPOSITORY:latest -f web/Dockerfile ./web | |
docker push $ACR_LOGIN_SERVER/$ACR_REPOSITORY:$IMAGE_TAG | |
docker push $ACR_LOGIN_SERVER/$ACR_REPOSITORY:latest | |
Deploy: | |
needs: build-and-push | |
runs-on: ubuntu-latest | |
if: needs.build-and-push.result == 'success' | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup kubeconfig | |
run: | | |
echo "${{ secrets.KUBECONFIG }}" | base64 --decode > kubeconfig | |
chmod 600 kubeconfig | |
- name: Install Helm | |
run: | | |
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash | |
- name: Add Helm chart repositories | |
run: | | |
helm repo add bitnami https://charts.bitnami.com/bitnami | |
helm repo add vespa https://onyx-dot-app.github.io/vespa-helm-charts | |
helm repo update | |
- name: Build Helm chart dependencies | |
run: helm dependency build ./deployment/helm/charts/onyx | |
- name: Deploy using Helm | |
env: | |
KUBECONFIG: ${{ github.workspace }}/kubeconfig | |
run: | | |
helm upgrade onyx-stack ./ -n onyx \ | |
--atomic \ | |
--wait \ | |
--reuse-values \ | |
--set webserver.image.repository=$ACR_LOGIN_SERVER/$ACR_REPOSITORY \ | |
--set webserver.image.tag=$IMAGE_TAG \ | |
--set webserver.image.pullPolicy=IfNotPresent |