Files
timerx/.gitlab-ci.yml
2023-11-11 09:17:40 +00:00

25 lines
661 B
YAML

stages:
- deploy
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' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
deploy_job:
stage: deploy
script:
- git remote remove github || true
- git remote add github git@github.com:yun-ink/timerx.git
- git remote -v
- git checkout master
- git fsck --full
- git prune
- git gc --prune=now --aggressive
- git push -u github master -f
only:
- master
- tags