Automating rasa action server docker deployment using gitlab CI/CD

what will be the alternate code for action server deployment in gitlab for docker image

on:
  push:
    branches:
      - main

jobs:
  build_and_deploy:
    runs-on: ubuntu-latest
    name: Build Action Server image and upgrade Rasa X deployment
    steps:
    [..]

    # This step shows only the example of output parameter usage
    # and it's not focused on deployment itself.
    - name: "Upgrade a Rasa X deployment"
      run: |
        helm upgrade --install --reuse-values \
          --set app.name=${{ steps.action_server.outputs.docker_image_name }} \
          --set app.tag=${{ steps.action_server.outputs.docker_image_tag }} rasa rasa-x/rasa-x

The above code is taken RASA documentation, This is the code is saw on rasa documentation to add action server image, my doubt is how do i edit this file using CI/CD, or is there any better way to automate deployment using gitlab CI/CD

version: '3.4'
services:
  app:
    image: <image:tag>

you can use as example gitlab cicd variables for the project via Gitlab WebUI or use .gitlab-ci.yml in the respective repo to update it via GitOps from the repository.

default:
    image:
        name: rasa/rasa:2.2.7
        entrypoint: [""]

variables:
  DOCKER_DRIVER: overlay2
  DOCKER_TLS_CERTDIR: ""
  DOCKER_HOST: tcp://docker:2375
  MOUNT_POINT: /builds/$CI_PROJECT_PATH/mnt
  TAG_LATEST: $CI_REGISTRY_IMAGE/$CI_COMMIT_REF_NAME:latest
  TAG_COMMIT: $CI_REGISTRY_IMAGE/$CI_COMMIT_REF_NAME:$CI_COMMIT_SHORT_SHA

services:
  - docker:dind

stages:
  - build 
  - deploy

build-action-image:
  stage: build
  image: docker:latest
  script:
    - docker build -t $TAG_COMMIT -t $TAG_LATEST .
    - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
    - docker push $TAG_COMMIT
    - docker push $TAG_LATEST
  only:
    refs: 
      - main
    changes:
        - 'actions/**'
  
deploy-action:
  stage: deploy
  image: alpine:latest
  script:
    - chmod og= $ID_RSA
    - apk update && apk add openssh-client
    - ssh -i $ID_RSA -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP "docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY"
    - ssh -i $ID_RSA -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP "docker container rm -f rasa_app_1 || true"
    - ssh -i $ID_RSA -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP "docker pull $TAG_LATEST"
    - ssh -i $ID_RSA -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP "docker-compose -f /etc/rasa/docker-compose.override.yml up -d app"

  only:
    refs: 
      - main
    changes:
        - 'actions/**'

this thing worked for me, in override file i am using only the “latest” tag

version: '3.4'
services:
  app:
    image: <image>:latest