digital-garden/.drone.yml
Struchkov Mark 9bf44cf990
Some checks failed
continuous-integration/drone/push Build is failing
cicd
2024-09-02 21:36:01 +03:00

46 lines
1.3 KiB
YAML

---
kind: pipeline
type: docker
name: docker-build-and-push
trigger:
branch:
- master
steps:
- name: build site
# https://hub.docker.com/r/library/docker
image: hub.docker.struchkov.dev/docker:27.1.2-dind-alpine3.20
commands:
- docker run -v ./.quartz/quartz.config.ts:/usr/src/app/quartz.config.ts -v .:/usr/src/app/content -v ./public:/usr/src/app/public --rm docker.struchkov.dev/quartz:latest build
- name: publish to server
image: hub.docker.struchkov.dev/docker:27.1.2-dind-alpine3.20
environment:
SSH_DEPLOY_KEY:
from_secret: SSH_DEPLOY_KEY
SSH_DEPLOY_HOST:
from_secret: SSH_DEPLOY_HOST
SSH_DEPLOY_PORT:
from_secret: SSH_DEPLOY_PORT
SSH_DEPLOY_PATH:
from_secret: SSH_DEPLOY_PATH
SSH_DEPLOY_USER:
from_secret: SSH_DEPLOY_USER
commands:
- eval $(ssh-agent -s)
- mkdir -p ~/.ssh
- echo "$SSH_DEPLOY_KEY" >> ~/.ssh/id_rsa
- chmod 700 ~/.ssh
- chmod 600 ~/.ssh/id_rsa
- ssh-keyscan -p $SSH_DEPLOY_PORT $SSH_DEPLOY_HOST >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- scp -r -P $SSH_DEPLOY_PORT ./* $SSH_DEPLOY_USER@$SSH_DEPLOY_HOST:$SSH_DEPLOY_PATH
# drone sign --save upagge/digital-garden
---
kind: signature
hmac: 2b8089ba3f96de64c99c185106cdedef4ed566ab496cb5d3a0d5b349fdb025f7
...