From a30e27280491ba1fd4a2d9d66c996a70de5b71e8 Mon Sep 17 00:00:00 2001 From: Paul Keen <125715+pftg@users.noreply.github.com> Date: Mon, 11 May 2020 22:42:00 +0300 Subject: [PATCH 1/5] Setup drone.io with publishing on github pages --- .circleci/setup-github | 11 ++--------- .drone.yml | 16 ++++++++++++---- .gitignore | 1 + bin/setup | 2 +- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.circleci/setup-github b/.circleci/setup-github index 965e650c..095f2fce 100755 --- a/.circleci/setup-github +++ b/.circleci/setup-github @@ -3,15 +3,8 @@ git config user.name "$USER_NAME" git config user.email "$USER_EMAIL" -git checkout master -git pull origin master - -find . -maxdepth 1 ! -name '_site' ! -name '.git' ! -name '.gitignore' -exec rm -rf {} \; -mv _site/* . -rm -R _site/ - -git add -fA +git add -fA _site git commit --allow-empty -m "$(git log develop -1 --pretty=%B)" -git push origin master +git push origin `git subtree split --prefix _site master`:master --force echo "deployed successfully" diff --git a/.drone.yml b/.drone.yml index 6c9b53ae..7d09e8b7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,9 +2,17 @@ kind: pipeline type: kubernetes name: default +clone: + depth: 1 + steps: - - name: greeting - image: alpine + - name: build + image: circleci/ruby:2.6.5-node-browsers commands: - - echo hello - - echo world + - bin/setup + - bin/build + - .circleci/setup-github + when: + branch: + - develop + - setup-build-on-drone-io diff --git a/.gitignore b/.gitignore index 45a96056..26f11e6d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ _site package-lock.json node_modules/ .DS_Store +.* diff --git a/bin/setup b/bin/setup index af759f09..7ec351ab 100755 --- a/bin/setup +++ b/bin/setup @@ -15,7 +15,7 @@ chdir APP_ROOT do # Add necessary setup steps to this file. puts '== Installing dependencies ==' - system! 'gem install bundler --conservative' + system! 'gem install bundler:1.17.3 --conservative' system('bundle check') || system!('bundle install') # Install JavaScript dependencies if using Yarn From ecf9aa12899806a9fec1213d759f83b23a13fc72 Mon Sep 17 00:00:00 2001 From: Paul Keen <125715+pftg@users.noreply.github.com> Date: Mon, 11 May 2020 23:02:51 +0300 Subject: [PATCH 2/5] Exit on failed push to github --- .circleci/setup-github | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/setup-github b/.circleci/setup-github index 095f2fce..3ef248a3 100755 --- a/.circleci/setup-github +++ b/.circleci/setup-github @@ -1,5 +1,7 @@ #!/bin/sh +set -e + git config user.name "$USER_NAME" git config user.email "$USER_EMAIL" From 263c0dfd4abc09fef70b1603968168e66a7e4f25 Mon Sep 17 00:00:00 2001 From: Paul Keen <125715+pftg@users.noreply.github.com> Date: Mon, 11 May 2020 23:47:38 +0300 Subject: [PATCH 3/5] Change deployment --- .circleci/setup-github | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/setup-github b/.circleci/setup-github index 3ef248a3..1a1aee92 100755 --- a/.circleci/setup-github +++ b/.circleci/setup-github @@ -1,12 +1,12 @@ #!/bin/sh -set -e - git config user.name "$USER_NAME" git config user.email "$USER_EMAIL" git add -fA _site git commit --allow-empty -m "$(git log develop -1 --pretty=%B)" -git push origin `git subtree split --prefix _site master`:master --force + +git subtree split --prefix=_site -b gh-publish +git push --force origin gh-publish:master echo "deployed successfully" From 9a21bb6bdb4c95074f65433465a8766a3df9421d Mon Sep 17 00:00:00 2001 From: Paul Keen <125715+pftg@users.noreply.github.com> Date: Mon, 11 May 2020 23:51:57 +0300 Subject: [PATCH 4/5] Run build only for selected branches --- .drone.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.drone.yml b/.drone.yml index 7d09e8b7..26cfe41c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,13 +6,14 @@ clone: depth: 1 steps: - - name: build - image: circleci/ruby:2.6.5-node-browsers - commands: - - bin/setup - - bin/build - - .circleci/setup-github - when: - branch: - - develop - - setup-build-on-drone-io +- name: build + image: circleci/ruby:2.6.5-node-browsers + commands: + - bin/setup + - bin/build + - .circleci/setup-github + +trigger: + branch: + - develop + - drone-io From fbb7cca48159b9d47c58e4e86718a67746821b0b Mon Sep 17 00:00:00 2001 From: Paul Keen <125715+pftg@users.noreply.github.com> Date: Tue, 12 May 2020 00:13:54 +0300 Subject: [PATCH 5/5] Experiment with allowing lock branches --- .drone.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.drone.yml b/.drone.yml index 26cfe41c..ad3242b1 100644 --- a/.drone.yml +++ b/.drone.yml @@ -9,6 +9,7 @@ steps: - name: build image: circleci/ruby:2.6.5-node-browsers commands: + - sudo chmod -R 775 .git - bin/setup - bin/build - .circleci/setup-github