From 7e75e2874c2ab54d67f00203c9c83c9dd76574f2 Mon Sep 17 00:00:00 2001 From: James Harton Date: Wed, 16 Aug 2023 12:41:21 +1200 Subject: [PATCH] chore: add CI config. --- .drone.yml | 87 ++++++++++++++++++++++++++++++++++++++++++++++ .gitignore | 1 + .tool-versions | 1 + static/.gitkeep | 0 templates/.gitkeep | 0 5 files changed, 89 insertions(+) create mode 100644 .drone.yml create mode 100644 .tool-versions create mode 100644 static/.gitkeep create mode 100644 templates/.gitkeep diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..af91eef --- /dev/null +++ b/.drone.yml @@ -0,0 +1,87 @@ +kind: pipeline +type: docker +name: deploy + +steps: +- name: submodules + image: alpine/git + commands: + - git submodule update --init --recursive + +- name: restore ASDF cache + image: meltwater/drone-cache + pull: "always" + environment: + AWS_ACCESS_KEY_ID: + from_secret: ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY: + from_secret: SECRET_ACCESS_KEY + AWS_PLUGIN_PATH_STYLE: true + settings: + restore: true + endpoint: + from_secret: S3_ENDPOINT + bucket: + from_secret: CACHE_BUCKET + region: us-east-1 + path-style: true + cache_key: 'asdf-{{ os }}-{{ arch }}-{{ checksum ".tool-versions" }}' + mount: + - .asdf + +- name: install dependencies + image: code.harton.nz/james/asdf_container:latest + pull: "always" + environment: + ASDF_DATA_DIR: /drone/src/.asdf + ASDF_DIR: /root/.asdf + commands: + - asdf_install + - rm -rf .asdf/downloads + +- name: store ASDF cache + image: meltwater/drone-cache + pull: "always" + environment: + AWS_ACCESS_KEY_ID: + from_secret: ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY: + from_secret: SECRET_ACCESS_KEY + AWS_PLUGIN_PATH_STYLE: true + settings: + rebuild: true + override: false + endpoint: + from_secret: S3_ENDPOINT + bucket: + from_secret: CACHE_BUCKET + region: us-east-1 + path-style: true + cache_key: 'asdf-{{ os }}-{{ arch }}-{{ checksum ".tool-versions" }}' + mount: + - .asdf + +- name: zola build + image: code.harton.nz/james/asdf_container:latest + pull: "always" + environment: + ASDF_DATA_DIR: /drone/src/.asdf + ASDF_DIR: /root/.asdf + commands: + - asdf zola build + +- name: publish + image: minio/mc + environment: + S3_ENDPOINT: + from_secret: S3_ENDPOINT + ACCESS_KEY: + from_secret: ACCESS_KEY_ID + SECRET_KEY: + from_secret: SECRET_ACCESS_KEY + commands: + - mc alias set store $${S3_ENDPOINT} $${ACCESS_KEY} $${SECRET_KEY} + - mc mb -p store/www.harton.nz + - mc anonymous set download store/www.harton.nz + - mc mirror public/ store/www.harton.nz/ + diff --git a/.gitignore b/.gitignore index a48cf0d..fe41b5f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ public +*.swp diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..bfd3259 --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +zola 0.17.2 diff --git a/static/.gitkeep b/static/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/templates/.gitkeep b/templates/.gitkeep new file mode 100644 index 0000000..e69de29