Hello Everyone , I am actually doing a CI to build IOS app so for this i already setup macos mini cloud with fastlane and everything working so good at server side , so now i am doing CI fro gitlab and its my first time for doing here i did before on github , i have shared server so they give me just one user SSH access with password , so i can’t install runner on server and can not add new user so i want CI to access server with username and password
stages:
- build
before_script:
- apt-get update -qq
- apt-get install -qq git
- apt-get install -qq sshpass
# Setup SSH deploy keys
- 'which ssh-agent || ( apt-get install -qq openssh-client )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
build:
stage: build
only:
refs:
- main
script:
- sshpass -p $_PASSWORD ssh $_USER@$_IP && echo "running scripts in the build job"
i did this gitlab.yml but its not working , just need suggestion how to rewrite following github action in gitlab
name: Deploy to Server
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy to Server
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: 22