44 lines
865 B
YAML
44 lines
865 B
YAML
image: registry.gitlab.com/pages/hugo:latest
|
|
|
|
stages:
|
|
- build
|
|
- deploy
|
|
|
|
|
|
variables:
|
|
GIT_SUBMODULE_STRATEGY: recursive
|
|
|
|
# This build stage will also leave artifacts ready for gitlab pages to use
|
|
build:
|
|
stage: build
|
|
only:
|
|
refs:
|
|
- master
|
|
script:
|
|
- hugo
|
|
artifacts:
|
|
paths:
|
|
- public
|
|
|
|
# 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
|