website/.gitlab-ci.yml

31 lines
690 B
YAML
Raw Normal View History

2024-08-15 09:51:57 +03:00
image: https://hub.docker.com/_/debian
stages:
- build
- upload
before_script:
- apt-get update
2024-08-15 09:51:57 +03:00
- apt-get install -y rsync openssh-client hugo
build:
stage: build
script:
- hugo
artifacts:
paths:
- public/
expire_in: 1 hour
upload:
stage: upload
script:
- mkdir -p ~/.ssh
- echo "$PRIVKEY" | base64 -d > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-keyscan -p 69 107.189.28.28 >> ~/.ssh/known_hosts
- rsync -avzh ./public/ -e "ssh -i ~/.ssh/id_rsa -p 69" root@107.189.28.28:/var/www/fzorb.xyz
- ssh -i ~/.ssh/id_rsa -p 69 root@107.189.28.28 "chmod 755 -R /var/www/fzorb.xyz"
only:
- main