+ Adding back deployment job

This commit is contained in:
shockrah 2022-01-26 12:10:59 -08:00
parent cba5e68fe2
commit 0e2623f65a

View File

@ -2,13 +2,13 @@ image: registry.gitlab.com/pages/hugo:latest
stages: stages:
- build - build
- vps - deploy
variables: variables:
GIT_SUBMODULE_STRATEGY: recursive GIT_SUBMODULE_STRATEGY: recursive
# Only because it's broken right now # This build stage will also leave artifacts ready for gitlab pages to use
build: build:
stage: build stage: build
only: only:
@ -19,6 +19,25 @@ build:
artifacts: artifacts:
paths: paths:
- public - public
only:
- master
# Here we deploy the site
deploy-to-athens:
stage: deploy
image: shockrah/website:latest
only:
refs:
- master
needs:
- build
dependencies:
- build
before_script:
- eval $(ssh-agent -s)
- echo "${WEB_USR_KEY}" | ssh-add - > /dev/null
- mkdir -p ~/.ssh/
- chmod 700 ~/.ssh/
- ssh-keyscan shockrah.xyz 2>&1 >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
- ssh web@shockrah.xyz "rm -rf /var/www/resume.shockrah.xyz"
- scp -r public/ web@shockrah.xyz:/var/www/resume.shockrah.xyz