resume/.gitlab-ci.yml

44 lines
865 B
YAML
Raw Normal View History

2019-08-20 02:57:47 +00:00
image: registry.gitlab.com/pages/hugo:latest
2019-08-20 02:55:29 +00:00
stages:
2021-11-06 03:15:11 +00:00
- build
2022-01-26 20:10:59 +00:00
- deploy
2019-08-20 02:57:47 +00:00
variables:
GIT_SUBMODULE_STRATEGY: recursive
2019-08-20 02:55:29 +00:00
2022-01-26 20:10:59 +00:00
# This build stage will also leave artifacts ready for gitlab pages to use
2021-11-06 03:15:11 +00:00
build:
stage: build
only:
refs:
- master
script:
- hugo
artifacts:
paths:
2019-08-20 02:55:29 +00:00
- public
2022-01-26 20:10:59 +00:00
# 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