blog/.gitlab-ci.yml
shockrah 7ef53be386 - SSH is now done properly with host key checking
* Smoothed out some ci formatting
- Pulling out neocities deploy pipeline
2021-08-16 17:11:10 -07:00

61 lines
995 B
YAML

image: shockrah/website:1.3
stages:
- build
- deploy
# Setup the SSH Key in required for VPS deployment first
before_script:
- eval "$(ssh-agent -s)"
- echo "${SSH_PRIVATE_KEY}" | ssh-add - > /dev/null
- mkdir -p ~/.ssh/
- chmod 700 ~/.ssh/
- ssh-keyscan $VPS_HOST 2>&1 >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
build-site:
only:
refs:
- master
stage: build
script:
- hugo
artifacts:
expire_in: 10 mins
paths:
- "public"
deploy-vps:
only:
refs:
- master
stage: deploy
# This is all fine because its just static html w/ no scripts :^)
script:
- ssh root@shockrah.xyz "rm -rf /var/www/website"
- scp -r public/ root@shockrah.xyz:/var/www/website/
deploy-neocities:
# This might get really ugly with neocities so hang on
only:
refs:
- neocities
stage: deploy
script:
# First the html
- bash upload.sh -h
# then we do the media files
- bash upload.sh -M