Skip to content

Fix RAG notebook following API change #112

Fix RAG notebook following API change

Fix RAG notebook following API change #112

name: Build and deploy when pushing on staging or main
on:
push:
branches:
- main
jobs:
build-and-push:
name: Build and push from ${{ github.ref_name }}/${{ github.sha }}
runs-on: ubuntu-latest
env:
APP_IMAGE_NAME: ghcr.io/${{ github.repository }}/app
UI_IMAGE_NAME: ghcr.io/${{ github.repository }}/ui
IMAGE_TAG: ${{ github.sha }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push app
uses: docker/build-push-action@v6
with:
context: .
file: ./app/Dockerfile
push: true
tags: ${{ env.APP_IMAGE_NAME }}:${{ env.IMAGE_TAG }},${{ env.APP_IMAGE_NAME }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push ui
uses: docker/build-push-action@v6
with:
context: .
file: ./ui/Dockerfile
push: true
tags: ${{ env.UI_IMAGE_NAME }}:${{ env.IMAGE_TAG }},${{ env.UI_IMAGE_NAME }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
deploy-dev:
name: Deploy from ${{ github.ref_name }}/${{ github.sha }}
runs-on: ubuntu-latest
needs: build-and-push
steps:
- name: Trigger dev deployment
run: |
RESPONSE="$(curl --request POST \
--form token=${{ secrets.GITLAB_CI_TOKEN }} \
--form ref=main \
--form 'variables[pipeline_name]=${{ github.event.repository.name }} - ${{ github.event.head_commit.message }}' \
--form 'variables[docker_image_tag]=latest' \
--form 'variables[application_to_deploy]=${{ github.event.repository.name }}' \
--form 'variables[deployment_environment]=dev' \
'https://gitlab.com/api/v4/projects/58117805/trigger/pipeline')"
if echo "$RESPONSE" | grep -q '"status":"created"'; then
echo $RESPONSE
else
echo $RESPONSE
exit 1
fi