From 41822ba3daee9cc11e7854454515437d37c9a167 Mon Sep 17 00:00:00 2001 From: Ad5001 Date: Mon, 9 Aug 2021 01:11:40 +0200 Subject: [PATCH] Building and auto publishing! --- .gitignore | 2 +- .gitmodules | 3 +++ ci/drone.yml | 71 +++++++++++++++++++++++++++++++++++++++++++++++++ themes/omegamma | 1 + 4 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 .gitmodules create mode 100644 ci/drone.yml create mode 160000 themes/omegamma diff --git a/.gitignore b/.gitignore index e7b3c8d..fdd5177 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ *.kdev4 kdev4 -themes +themes/Omegamma public resources diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..dd08668 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "themes/omegamma"] + path = themes/omegamma + url = https://git.ad5001.eu/Ad5001/omegamma diff --git a/ci/drone.yml b/ci/drone.yml new file mode 100644 index 0000000..40f3f27 --- /dev/null +++ b/ci/drone.yml @@ -0,0 +1,71 @@ +kind: pipeline +name: default + +clone: + git: + image: plugins/git + recursive: true + +steps: + - name: Initilizing submodules + image: alpine/git + environment: + GIT_ASKPASS: "/bin/git-askpass-from-env" + commands: + # Installing little script to get git password from environment. + - wget https://download.ad5001.eu/other/git-askpass-from-env.sh + - mv git-askpass-from-env.sh /bin/git-askpass-from-env + - chmod +x /bin/git-askpass-from-env + # Changing submodule URL to https://@git.ad5001.eu/Ad5001/omegamma.git + - git submodule init + - git config submodule.sub/omegamma.url https://$DRONE_GIT_USERNAME@git.ad5001.eu/Ad5001/omegamma.git + # Fetching submodules + - git submodule update --init --recursive + + - name: Build dev.apps.ad5001.eu + image: xdevbase/hugo-builder:latest + commands: + - hugo -b https://dev.apps.ad5001.eu + when: + event: [ push, tag ] + branch: [ main ] + + - name: Deploy dev.apps.ad5001.eu + image: appleboy/drone-scp + settings: + host: + from_secret: SSH_HOST + username: + from_secret: SSH_USERNAME + password: + from_secret: SSH_PASSWORD + target: + from_secret: DEV_WWW_PATH + source: public/* + when: + event: [ push, tag ] + branch: [ main ] + + - name: Build apps.ad5001.eu + image: xdevbase/hugo-builder:latest + commands: + - hugo -b https://apps.ad5001.eu + when: + event: [ push, tag ] + branch: [ prod ] + + - name: Deploy apps.ad5001.eu + image: appleboy/drone-scp + settings: + host: + from_secret: SSH_HOST + username: + from_secret: SSH_USERNAME + password: + from_secret: SSH_PASSWORD + target: + from_secret: PROD_WWW_PATH + source: public/* + when: + event: [ push, tag ] + branch: [ prod ] diff --git a/themes/omegamma b/themes/omegamma new file mode 160000 index 0000000..d5c7d6c --- /dev/null +++ b/themes/omegamma @@ -0,0 +1 @@ +Subproject commit d5c7d6c2cc392cce306f4354b59fc07fc4504b82