You can achieve this using Git and Jenkins job. Create a Jenkins Job to deploy your code to server and Setup Git webhook to Call Jenkins job.
Check this link: https://www.serverkaka.com/2019/02/configure-github-webhook-in-jenkins-job-pipeline.html
Create an empty Git repo on the server
Write a Git Hook to deploy the code
Deploy from the local ...
You can use the Jenkins provided step dir() which changes the directory to one relative to the Jenkins env.WORKSPACE (/var/lib/jenkins/workspace/JOB_NAME by default).
// do stuff
// do other stuff
Yes, full cloning of LFS files can be restricted! By default, GitLab will clone your repo into the CI/CD build directory. To limit the clone from downloading the LFS files, tell it not to do it. You do this by setting a variable in .gitlab-ci.yml like this.
# Other declarations etc above the specific job
There is no equivalent for before_script. However you can define a function in your pipeline and call it in the begining of each stage.
Yes, there is:
If your commit message contains [ci skip] or [skip ci], using any capitalization, the commit will be created but the pipeline will be skipped.
Alternatively, one can pass the ci.skip Git push option if using Git 2.10 or newer:
git push -o ci.skip
From: GitLab CI YAML documentation - "Skipping jobs"