added a pipeline to help build and deploy the docker code

This commit is contained in:
Hamza Ahmed
2021-12-02 20:54:28 +00:00
parent 7df29706db
commit 1fee84bfcd
+30
View File
@@ -0,0 +1,30 @@
stages:
- build
- deploy
build:
stage: build
image: ahmza/hugo
script:
- git submodule update --init --recursive
- hugo -d public_html -b "${BLOG_URL}"
cache:
paths:
- public_html
artifacts:
paths:
- public_html
only:
-master
deploy:
stage: deploy
image: ahmza/rsync-ssh
script:
- echo "${SSH_PRIVATE_KEY}" > id_rsa
- chmod 700 id_rsa
- mkdir "${HOME}/.ssh"
- echo "${SSH_HOST_KEY}" > "${HOME}/.ssh/known_hosts"
- rsync -hrvz --delete --exclude=_ -e 'ssh -i id_rsa' public_html/ "${SSH_USER_HOST_LOCATION}"
only:
-master