2019-08-20 02:57:47 +00:00
|
|
|
image: registry.gitlab.com/pages/hugo:latest
|
2019-08-20 02:55:29 +00:00
|
|
|
|
2021-02-22 21:21:58 +00:00
|
|
|
stages:
|
2021-11-06 03:15:11 +00:00
|
|
|
- build
|
2022-01-26 20:10:59 +00:00
|
|
|
- deploy
|
2021-02-22 21:21:58 +00:00
|
|
|
|
|
|
|
|
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
|
2021-10-19 07:24:07 +00:00
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- master
|
2019-08-20 02:41:28 +00:00
|
|
|
script:
|
|
|
|
- hugo
|
|
|
|
artifacts:
|
|
|
|
paths:
|
2019-08-20 02:55:29 +00:00
|
|
|
- public
|
2021-02-22 21:21:58 +00:00
|
|
|
|
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
|