I tried to find a solution for this problem but couldn't find any.
The issue:
We have image files in /public/img/InfoNews/example.png
and every time we push an update gitlab-runner removes those files on the remote.
We have /public/img/InfoNews
in our .gitignore
this prevents git from uploading local files but not from deleting remote files in that folder for some reason.
I tried to add this path to the cache and artifacts in .gitlab-ci.yml
without success
A push in the right direction is appreciated.
Our .gitlab-ci.yml
:
cache:
paths:
- vendor/
- public/img/
deploy:
stage: deploy
script:
- php artisan cache:clear
- rm -rf vendor/
- composer install
- echo "$env" > "$(pwd)/.env"
- php artisan migrate
artifacts:
paths:
- .env
- public/img/
EDIT:
I also tried
cache:
untracked: true
paths:
- vendor/
- public/img/
But it still deletes the files.
.gitlab-ci.yml
please?