From 8449ba4735d521ee48699ab53a77e4c912e104de Mon Sep 17 00:00:00 2001 From: kjuulh Date: Wed, 2 Aug 2023 14:39:15 +0200 Subject: [PATCH] feat: with drone yml Signed-off-by: kjuulh --- .drone.yml | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..14a817c --- /dev/null +++ b/.drone.yml @@ -0,0 +1,120 @@ +kind: pipeline +name: default +type: docker + +steps: + - name: build ci + image: rustlang/rust:nightly + commands: + - cd ci || return 1 + - cargo build + - cd - || return 1 + + - name: load_secret + image: debian:buster-slim + volumes: + - name: ssh + path: /root/.ssh/ + environment: + SSH_KEY: + from_secret: gitea_id_ed25519 + commands: + - mkdir -p $HOME/.ssh/ + - echo "$SSH_KEY" | base64 -d > $HOME/.ssh/id_ed25519 + + - name: build + image: kasperhermansen/cuddle:latest + pull: always + volumes: + - name: ssh + path: /root/.ssh/ + - name: dockersock + path: /var/run + commands: + - eval `ssh-agent` + - chmod -R 600 ~/.ssh + - ssh-add + - cuddle x ci:all + environment: + DOCKER_BUILDKIT: 1 + CUDDLE_SECRETS_PROVIDER: 1password + CUDDLE_ONE_PASSWORD_DOT_ENV: ".env.ci" + CUDDLE_SSH_AGENT: "true" + OP_SERVICE_ACCOUNT_TOKEN: + from_secret: op_service_account_token + + depends_on: + - "load_secret" + - "build ci" + + - name: build main + image: kasperhermansen/cuddle:latest + pull: always + volumes: + - name: ssh + path: /root/.ssh/ + - name: dockersock + path: /var/run + commands: + - eval `ssh-agent` + - chmod -R 600 ~/.ssh + - ssh-add + - cuddle x build:release:all + - cuddle x deploy:docs:preview + - cuddle x please:release + environment: + DOCKER_BUILDKIT: 1 + CUDDLE_SECRETS_PROVIDER: 1password + CUDDLE_ONE_PASSWORD_DOT_ENV: ".env.ci" + CUDDLE_SSH_AGENT: "true" + OP_SERVICE_ACCOUNT_TOKEN: + from_secret: op_service_account_token + when: + branch: + - main + - master + depends_on: + - "build" + + - name: deploy release + image: kasperhermansen/cuddle:latest + pull: always + volumes: + - name: ssh + path: /root/.ssh/ + - name: dockersock + path: /var/run + commands: + - eval `ssh-agent` + - chmod -R 600 ~/.ssh + - ssh-add + - cuddle x build:release:all + - cuddle x deploy:docs:preview + environment: + DOCKER_BUILDKIT: 1 + CUDDLE_SECRETS_PROVIDER: 1password + CUDDLE_ONE_PASSWORD_DOT_ENV: ".env.ci" + CUDDLE_SSH_AGENT: "true" + OP_SERVICE_ACCOUNT_TOKEN: + from_secret: op_service_account_token + when: + ref: + include: + - refs/tags/v** + depends_on: + - "load_secret" + - "build ci" + +services: +- name: docker + image: docker:dind + privileged: true + volumes: + - name: dockersock + path: /var/run + +volumes: + - name: ssh + temp: {} + - name: dockersock + temp: {} \ No newline at end of file