From 516791bb33d421d2baaa3b146297cc663e188109 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Sat, 18 Feb 2023 15:07:10 -0500 Subject: [PATCH] Add CI/CD via Drone (#1) Reviewed-on: https://git.tomaka.onl/atomaka/atomaka.com/pulls/1 --- .drone.yml | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ Makefile | 7 ------- README.md | 2 ++ 3 files changed, 53 insertions(+), 7 deletions(-) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..1bdeab6 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,51 @@ +name: test +kind: pipeline + +steps: + - name: jekyll-build + image: ruby + commands: + - gem install bundler + - bundle install + - bundle exec jekyll build + +trigger: + branch: + exclude: master + event: push + +--- +name: deploy +kind: pipeline + +steps: + - name: jekyll-build + image: ruby + commands: + - gem install bundler + - bundle install + - bundle exec jekyll build + - name: docker-build + image: plugins/docker + settings: + pull_image: true + registry: docker.atomaka.com + repo: docker.atomaka.com/atomaka.com + tags: + - latest + - ${DRONE_TAG} + - name: deploy + image: appleboy/drone-ssh + settings: + host: + from_secret: unraid_host + username: + from_secret: unraid_username + key: + from_secret: unraid_ssh_key + script: + - docker pull docker.atomaka.com/atomaka.com:latest + - docker restart atomaka.com + +trigger: + event: tag diff --git a/Makefile b/Makefile index 350ac25..224e357 100644 --- a/Makefile +++ b/Makefile @@ -2,13 +2,6 @@ build: bundle exec jekyll build docker build . -t atomaka.com -push: build - docker tag atomaka.com:latest docker.atomaka.com/atomaka.com:latest - docker push docker.atomaka.com/atomaka.com:latest - -deploy: push - ssh $$SSH_USERNAME@$$SSH_HOST 'docker pull docker.atomaka.com/atomaka.com:latest && docker restart atomaka.com' - review: docker exec -it atomaka.com sh diff --git a/README.md b/README.md index c5b76ee..9372cd8 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Build Status](http://drone.tomaka.onl/api/badges/atomaka/atomaka.com/status.svg)](http://drone.tomaka.onl/atomaka/atomaka.com) + # atomaka.com Website managed by jekyll.