Merge pull request #9 from TukaTek/feature/TUK-23 #6
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: Debug Current Directory | |
run: | | |
echo "Current working directory:" | |
pwd | |
echo "Files and folders in current directory:" | |
ls -al | |
echo "Looking into ./deployment/helm/charts:" | |
ls -al ./deployment/helm/charts/onyx || echo "Directory not found" | |
- 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: Deploy using Helm | |
env: | |
KUBECONFIG: ${{ github.workspace }}/kubeconfig | |
run: | | |
helm upgrade onyx ./deployment/helm/charts/onyx -n onyx \ | |
--set postgresql.primary.persistence.enabled=false \ | |
--set webserver.images.repository=$ACR_LOGIN_SERVER/$ACR_REPOSITORY \ | |
--set webserver.images.tag=$IMAGE_TAG |