Gitlab CI/CD Deployment to Local Tomcat

I am new to CI/CD and now trying to deploy a maven Java project in Gitlab repository using the Gitlab CI/CD features. The deployment step will be successful if it is destined to the build-in docker image. But, when I am trying to deploy in my local computer destination, the deployment step fails. Could anybody have any idea about this?

I have tried in Mac OSX to register and run the gitlab-runner to process the CI/CD. I have already installed the docker.

This is the .gitlab-ci.yml file.

image: maven:latest

stages:
  - build
  - test
  - deploy

variables:
  MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
  MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
  SSH_PRIVATE_KEY: "b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAA..."
  SSH_KNOWN_HOSTS: "# YmkSun.local:22 SSH-2.0-OpenSSH_7.9
ymksun.local ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSMOpRI..."
  DEPLOY_USER: "yemyokyaw"
  DEPLOY_HOST: "YmkSun.local"
  DEPLOY_PATH: "/Users/yemyokyaw/Documents/tmp"


cache:
  paths:
    - .m2/repository/
    - target/ 

build_app:
  stage: build
  dependencies: []
  script:
  - mvn $MAVEN_CLI_OPTS compile

test:
  stage: test
  script:
    - mvn $MAVEN_CLI_OPTS test

deploy:stand:
  stage: deploy
  dependencies: []
  environment:
    name: staging
  before_script:
    - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
    - eval $(ssh-agent -s)
    - echo "$SSH_PRIVATE_KEY" | tr -d '\r' 
    - mkdir -p ~/.ssh
    - chmod 700 ~/.ssh
    - echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
    - chmod 644 ~/.ssh/known_hosts
  script:

    - ssh yemyokyaw@YmkSun.local "cd /builds/ymksun/sample-cicd-parent && git checkout master && git pull origin master && exit"

    - ssh $DEPLOY_USER@$DEPLOY_HOST "cd '$DEPLOY_PATH'; git pull; docker restart home-assistant"

Error message when I try the second script:

$ ssh $DEPLOY_USER@$DEPLOY_HOST "cd '$DEPLOY_PATH'; git pull; docker restart home-assistant" ssh: connect to host localhost port 22: Cannot assign requested address

Error message when I try the first script:

$ ssh yemyokyaw@YmkSun.local "cd /builds/ymksun/sample-cicd-parent && git checkout master && git pull origin master && exit" Host key verification failed.