blog/.gitlab-ci.yml

61 lines
995 B
YAML
Raw Normal View History

2021-02-09 03:22:48 +00:00
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
2021-02-09 03:22:48 +00:00
build-site:
only:
refs:
- master
stage: build
script:
- hugo
2021-02-09 03:22:48 +00:00
artifacts:
expire_in: 10 mins
paths:
- "public"
2021-02-09 03:22:48 +00:00
deploy-vps:
only:
refs:
- master
2021-02-09 03:22:48 +00:00
stage: deploy
# This is all fine because its just static html w/ no scripts :^)
2021-02-09 03:22:48 +00:00
script:
- ssh root@shockrah.xyz "rm -rf /var/www/website"
- scp -r public/ root@shockrah.xyz:/var/www/website/
2021-02-09 03:22:48 +00:00
deploy-neocities:
# This might get really ugly with neocities so hang on
only:
refs:
- neocities
2021-02-09 03:22:48 +00:00
stage: deploy
script:
# First the html
- bash upload.sh -h
# then we do the media files
- bash upload.sh -M
2021-02-09 03:22:48 +00:00