2024-09-02 09:17:32 +03:00
|
|
|
|
---
|
|
|
|
|
kind: pipeline
|
|
|
|
|
type: docker
|
|
|
|
|
name: docker-build-and-push
|
|
|
|
|
|
2024-09-04 23:30:06 +03:00
|
|
|
|
clone:
|
|
|
|
|
disable: true
|
|
|
|
|
|
2024-09-02 09:17:32 +03:00
|
|
|
|
trigger:
|
|
|
|
|
branch:
|
2024-09-02 21:35:52 +03:00
|
|
|
|
- master
|
2024-09-02 09:17:32 +03:00
|
|
|
|
|
2024-09-02 21:38:16 +03:00
|
|
|
|
image_pull_secrets:
|
|
|
|
|
- DOCKER_AUTH
|
|
|
|
|
|
2024-09-02 09:17:32 +03:00
|
|
|
|
steps:
|
2024-09-02 21:35:14 +03:00
|
|
|
|
- name: build site
|
2024-09-02 09:17:32 +03:00
|
|
|
|
# https://hub.docker.com/r/library/docker
|
2024-09-04 22:10:01 +03:00
|
|
|
|
pull: always
|
2024-09-03 12:18:07 +03:00
|
|
|
|
image: docker.struchkov.dev/quartz:develop
|
2024-09-18 19:28:21 +03:00
|
|
|
|
environment:
|
|
|
|
|
GITHUB_SSH:
|
|
|
|
|
from_secret: GITHUB_SSH
|
2024-09-02 09:17:32 +03:00
|
|
|
|
commands:
|
2024-09-18 19:28:21 +03:00
|
|
|
|
- eval $(ssh-agent -s)
|
|
|
|
|
- mkdir -p ~/.ssh
|
|
|
|
|
- chmod 700 ~/.ssh
|
|
|
|
|
- echo "$GITHUB_SSH" >> ~/.ssh/id_rsa
|
|
|
|
|
- chmod 600 ~/.ssh/id_rsa
|
2024-09-18 19:36:34 +03:00
|
|
|
|
- ssh-keyscan github.com >> ~/.ssh/known_hosts
|
2024-09-18 19:28:21 +03:00
|
|
|
|
- chmod 644 ~/.ssh/known_hosts
|
2024-09-05 03:05:17 +03:00
|
|
|
|
- git clone https://git.struchkov.dev/upagge/digital-garden.git /usr/src/app/content
|
2024-09-18 19:38:28 +03:00
|
|
|
|
- cd /usr/src/app/content
|
2024-09-18 19:28:21 +03:00
|
|
|
|
- git remote add github git@github.com:uPagge/digital-garden.git
|
|
|
|
|
- git push github
|
2024-09-05 03:05:17 +03:00
|
|
|
|
- cd /usr/src/app
|
2024-09-07 11:57:48 +03:00
|
|
|
|
- cp ./content/.quartz/quartz.config.ts .
|
|
|
|
|
- cp ./content/.quartz/quartz.layout.ts .
|
2024-09-03 12:39:27 +03:00
|
|
|
|
- npx quartz build
|
2024-09-09 07:15:55 +03:00
|
|
|
|
- mv public /drone/src
|
2024-09-02 21:35:14 +03:00
|
|
|
|
- name: publish to server
|
2024-09-02 21:43:05 +03:00
|
|
|
|
image: private.docker.struchkov.dev/mkdocs:latest
|
2024-09-02 21:35:14 +03:00
|
|
|
|
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
|
2024-09-18 22:04:39 +03:00
|
|
|
|
- tar czf - ./public/* | ssh -С -p $SSH_DEPLOY_PORT $SSH_DEPLOY_USER@$SSH_DEPLOY_HOST "cd $SSH_DEPLOY_PATH/ru-new && tar xzf -"
|
2024-09-10 16:53:19 +03:00
|
|
|
|
- ssh -p $SSH_DEPLOY_PORT $SSH_DEPLOY_USER@$SSH_DEPLOY_HOST "rm -rf $SSH_DEPLOY_PATH/ru/* && mv $SSH_DEPLOY_PATH/ru-new/* $SSH_DEPLOY_PATH/ru"
|
2024-09-02 21:35:14 +03:00
|
|
|
|
|
2024-09-02 09:17:32 +03:00
|
|
|
|
|
2024-09-02 21:35:14 +03:00
|
|
|
|
# drone sign --save upagge/digital-garden
|
2024-09-02 09:17:32 +03:00
|
|
|
|
---
|
|
|
|
|
kind: signature
|
2024-09-18 22:04:39 +03:00
|
|
|
|
hmac: 3d2b62aef4c7d90a04d656fdc67c1e074e6dd0dd2534119bb9b913f8e2881f1a
|
2024-09-02 09:17:32 +03:00
|
|
|
|
|
2024-09-02 21:35:14 +03:00
|
|
|
|
...
|