From 63ee80ae982a9fa9b09d955cfd21965bc6d0bee4 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Thu, 1 Apr 2021 01:32:03 -0500 Subject: [PATCH 01/12] Add .drone.yml --- .drone.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..e42f1c6 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,24 @@ +--- +kind: pipeline +type: docker +name: Deploy to bbaovanc.com + +steps: + - name: Build site + image: mapitman/docker-hugo + commands: + - hugo version + - hugo --minify + + - name: Upload files + image: appleboy/drone-scp + aettings: + host: bbaovanc.com + port: 2222 + username: droneci + key: + from_secret: SSH_KEY + target: /var/www/bbaovanc/blog + rm: true + source: + - public/* -- 2.45.2 From 836a6a580927e59ede4f9b4ba926917a45ab5766 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Wed, 14 Apr 2021 00:19:39 -0500 Subject: [PATCH 02/12] Update submodules --- .drone.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.drone.yml b/.drone.yml index e42f1c6..773168f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,6 +4,11 @@ type: docker name: Deploy to bbaovanc.com steps: + - name: Update submodules + image: alpine/git + commands: + - git submodule update --init --recursive + - name: Build site image: mapitman/docker-hugo commands: -- 2.45.2 From c1ee8921a4a06bbfffd66676b63e0e57f720fcd1 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Wed, 14 Apr 2021 00:21:41 -0500 Subject: [PATCH 03/12] Upload to /tmp for now (during testing) --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 773168f..31c93d5 100644 --- a/.drone.yml +++ b/.drone.yml @@ -23,7 +23,7 @@ steps: username: droneci key: from_secret: SSH_KEY - target: /var/www/bbaovanc/blog + target: /tmp/blog rm: true source: - public/* -- 2.45.2 From 3cb6b08c92bc89ffcc2a0ddf91f4ac8808446cb3 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Wed, 14 Apr 2021 00:25:31 -0500 Subject: [PATCH 04/12] Fix settings typo... --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 31c93d5..847377c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -17,7 +17,7 @@ steps: - name: Upload files image: appleboy/drone-scp - aettings: + settings: host: bbaovanc.com port: 2222 username: droneci -- 2.45.2 From 54ebcd5c697d2ef658a38be4c9a2732b74c261b7 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Wed, 14 Apr 2021 00:33:32 -0500 Subject: [PATCH 05/12] Make folder named "blog" --- .drone.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 847377c..d103c7a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -13,7 +13,9 @@ steps: image: mapitman/docker-hugo commands: - hugo version - - hugo --minify + - hugo --minify -d blog/ + + - name: - name: Upload files image: appleboy/drone-scp @@ -23,7 +25,7 @@ steps: username: droneci key: from_secret: SSH_KEY - target: /tmp/blog + target: /tmp/ rm: true source: - - public/* + - blog/ -- 2.45.2 From e97e667c1ffc09cdb2ab05ca607bd5a39f7cd514 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Wed, 14 Apr 2021 00:34:05 -0500 Subject: [PATCH 06/12] Fix syntax error --- .drone.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index d103c7a..c28db30 100644 --- a/.drone.yml +++ b/.drone.yml @@ -15,8 +15,6 @@ steps: - hugo version - hugo --minify -d blog/ - - name: - - name: Upload files image: appleboy/drone-scp settings: -- 2.45.2 From c7dc7e05be6ae463ca53a85cf682d10aeb1d5279 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Wed, 14 Apr 2021 00:37:31 -0500 Subject: [PATCH 07/12] Compress blog into tar.gz before upload --- .drone.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index c28db30..d250d8c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -13,7 +13,12 @@ steps: image: mapitman/docker-hugo commands: - hugo version - - hugo --minify -d blog/ + - hugo --minify + + - name: Compress public folder + image: alpine/latest + commands: + - tar -czvf deploy.tar.gz public/* - name: Upload files image: appleboy/drone-scp @@ -23,7 +28,6 @@ steps: username: droneci key: from_secret: SSH_KEY - target: /tmp/ + target: /tmp/blog/ rm: true - source: - - blog/ + source: deploy.tar.gz -- 2.45.2 From a67a689a878cc57221dc41617711f35ef83e27ec Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Wed, 14 Apr 2021 00:38:31 -0500 Subject: [PATCH 08/12] Fix error in alpine image name --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index d250d8c..f26ed2c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -16,7 +16,7 @@ steps: - hugo --minify - name: Compress public folder - image: alpine/latest + image: alpine commands: - tar -czvf deploy.tar.gz public/* -- 2.45.2 From 6f757f36ef37341ae1f9e9e43e4273610d1748d8 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Wed, 14 Apr 2021 00:41:24 -0500 Subject: [PATCH 09/12] Use strip_components --- .drone.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.drone.yml b/.drone.yml index f26ed2c..7748872 100644 --- a/.drone.yml +++ b/.drone.yml @@ -15,11 +15,6 @@ steps: - hugo version - hugo --minify - - name: Compress public folder - image: alpine - commands: - - tar -czvf deploy.tar.gz public/* - - name: Upload files image: appleboy/drone-scp settings: @@ -30,4 +25,5 @@ steps: from_secret: SSH_KEY target: /tmp/blog/ rm: true - source: deploy.tar.gz + source: public/ + strip_components: 1 -- 2.45.2 From 091186c02c2f67319fb336321eb3fef6836f9cb8 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Wed, 14 Apr 2021 00:43:45 -0500 Subject: [PATCH 10/12] Change location to production location --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 7748872..dcd017a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -23,7 +23,7 @@ steps: username: droneci key: from_secret: SSH_KEY - target: /tmp/blog/ + target: /var/www/bbaovanc/blog/ rm: true source: public/ strip_components: 1 -- 2.45.2 From f9f4140b30b2649768b940a742b85af964969475 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Wed, 14 Apr 2021 00:49:47 -0500 Subject: [PATCH 11/12] Only trigger when pushing to master --- .drone.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.drone.yml b/.drone.yml index dcd017a..6dd1470 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,6 +3,10 @@ kind: pipeline type: docker name: Deploy to bbaovanc.com +trigger: + branch: + - master + steps: - name: Update submodules image: alpine/git -- 2.45.2 From f70c0f807ad5f886313469dc6d7a9b0ad989db54 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Wed, 14 Apr 2021 00:54:15 -0500 Subject: [PATCH 12/12] Exclude pull requests --- .drone.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.drone.yml b/.drone.yml index 6dd1470..b832043 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,6 +6,9 @@ name: Deploy to bbaovanc.com trigger: branch: - master + event: + exclude: + - pull_request steps: - name: Update submodules -- 2.45.2