2021-08-17 00:27:54 +00:00
|
|
|
image: shockrah/website:latest
|
2021-02-09 03:22:48 +00:00
|
|
|
|
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
- deploy
|
|
|
|
|
2021-08-17 00:11:10 +00:00
|
|
|
|
2021-02-09 03:22:48 +00:00
|
|
|
build-site:
|
2021-08-14 22:15:37 +00:00
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- master
|
|
|
|
|
2020-10-26 07:51:40 +00:00
|
|
|
stage: build
|
2021-02-09 03:43:48 +00:00
|
|
|
|
2020-10-26 07:51:40 +00:00
|
|
|
script:
|
2021-08-17 05:05:31 +00:00
|
|
|
- hugo version
|
2021-08-17 00:11:10 +00:00
|
|
|
- hugo
|
2021-02-09 03:22:48 +00:00
|
|
|
|
2021-02-09 03:43:48 +00:00
|
|
|
artifacts:
|
|
|
|
expire_in: 10 mins
|
2021-08-17 00:11:10 +00:00
|
|
|
paths:
|
|
|
|
- "public"
|
2021-02-09 03:43:48 +00:00
|
|
|
|
2021-02-09 03:22:48 +00:00
|
|
|
deploy-vps:
|
2021-08-14 22:15:37 +00:00
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- master
|
|
|
|
|
2021-02-09 03:22:48 +00:00
|
|
|
stage: deploy
|
|
|
|
|
2021-08-17 05:05:31 +00:00
|
|
|
# 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-08-17 00:11:10 +00:00
|
|
|
# This is all fine because its just static html w/ no scripts :^)
|
2021-02-09 03:22:48 +00:00
|
|
|
script:
|
2021-08-17 00:11:10 +00:00
|
|
|
- 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:
|
2021-08-17 00:11:10 +00:00
|
|
|
# This might get really ugly with neocities so hang on
|
2021-08-14 22:15:37 +00:00
|
|
|
only:
|
|
|
|
refs:
|
2021-08-17 00:11:10 +00:00
|
|
|
- neocities
|
2021-08-14 22:15:37 +00:00
|
|
|
|
2021-02-09 03:22:48 +00:00
|
|
|
stage: deploy
|
|
|
|
|
|
|
|
script:
|
|
|
|
# First the html
|
|
|
|
- bash upload.sh -h
|
|
|
|
# then we do the media files
|
2021-02-09 03:49:08 +00:00
|
|
|
- bash upload.sh -M
|
2021-02-09 03:22:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|