digital-garden/.drone.yml
Struchkov Mark 9d1fa85275
Some checks failed
continuous-integration/drone/push Build is failing
backup
2024-09-04 18:20:39 +03:00

56 lines
1.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
kind: pipeline
type: docker
name: docker-build-and-push
trigger:
branch:
- master
image_pull_secrets:
- DOCKER_AUTH
steps:
- name: build site
# https://hub.docker.com/r/library/docker
pull: always
image: docker.struchkov.dev/quartz:develop
commands:
- cp -r ./* /usr/src/app/content
- cp ./.quartz/quartz.config.ts /usr/src/app/
- cp ./.quartz/quartz.layout.ts /usr/src/app/
- cd /usr/src/app/
- npx quartz build
- mv /usr/src/app/public /drone/srс
- name: publish to server
image: private.docker.struchkov.dev/mkdocs:latest
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
- ssh -p $SSH_DEPLOY_PORT $SSH_DEPLOY_USER@$SSH_DEPLOY_HOST "rm -rf $SSH_DEPLOY_PATH/*"
- scp -r -P $SSH_DEPLOY_PORT ./public/* $SSH_DEPLOY_USER@$SSH_DEPLOY_HOST:$SSH_DEPLOY_PATH
# drone sign --save upagge/digital-garden
---
kind: signature
hmac: 0bb195e98e5da17cfee4f455efc38c49df2cd15e5c1f28bdeab07b7cc955a29d
...