From 71c00883858b861caa613233f758a380e0a692ca Mon Sep 17 00:00:00 2001 From: shockrah Date: Sun, 17 Oct 2021 16:04:53 -0700 Subject: [PATCH] * using my own vps instead of pages because it enver updates --- .gitlab-ci.yml | 28 ++++++++++++++++++---------- scripts/nginx.conf | 5 +++++ 2 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 scripts/nginx.conf diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c0c6b7d..9a236ab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ image: rustlang/rust:nightly stages: - build + - deploy # Builds out the intended zip package package: @@ -18,15 +19,22 @@ package: paths: - build/ -website: - image: - name: klakegg/hugo:ext-alpine - entrypoint: [""] - stage: build +upload-website: + image: shockrah/website:latest + stage: deploy + before_script: + - eval "$(ssh-agent -s)" + - echo "${SSH_PRIVATE_KEY}" | ssh-add - > /dev/null + - mkdir -p ~/.ssh/ + - chmod 700 ~/.ssh/ + - ssh-keyscan $VPS_HOST 2>&1 >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + script: - - cd gitpage + # Build then upload + - cd gitpage/ - hugo - - mv public/ .. - artifacts: - paths: - - public/ + - cd ../ + - ssh root@shockrah.xyz "rm -rf /var/www/clippable" + - scp -r gitpage/public/ root@shockrah.xyz:/var/www/clippable + diff --git a/scripts/nginx.conf b/scripts/nginx.conf new file mode 100644 index 0000000..18065dd --- /dev/null +++ b/scripts/nginx.conf @@ -0,0 +1,5 @@ +server { + root /var/www/clippable; + index index.html; + server_name clippable.shockrah.xyz; +}