This reverts commit 7ae35419fd
.
main
parent
bcdcb9f37b
commit
853057e8b4
@ -0,0 +1,91 @@ |
||||
kind: pipeline |
||||
type: docker |
||||
name: default |
||||
trigger: |
||||
branch: |
||||
- main |
||||
|
||||
steps: |
||||
- name: restore-cache |
||||
image: drillster/drone-volume-cache |
||||
depends_on: [clone] |
||||
volumes: |
||||
- name: cache |
||||
path: /cache |
||||
settings: |
||||
restore: true |
||||
mount: |
||||
- ./.bundle |
||||
|
||||
- name: build |
||||
image: ruby:2.7 |
||||
depends_on: [restore-cache] |
||||
commands: |
||||
- export BUNDLE_PATH="./.bundle" |
||||
- make install |
||||
- make http |
||||
- make gopher |
||||
|
||||
- name: rebuild-cache |
||||
image: drillster/drone-volume-cache |
||||
depends_on: [build] |
||||
volumes: |
||||
- name: cache |
||||
path: /cache |
||||
settings: |
||||
rebuild: true |
||||
mount: |
||||
- ./.bundle |
||||
|
||||
- name: degrade-images |
||||
image: ruby:2.7 |
||||
depends_on: [clone] |
||||
commands: |
||||
- make degrade |
||||
|
||||
- name: save-degraded-images |
||||
image: ruby:2.7 |
||||
depends_on: [degrade-images] |
||||
commands: |
||||
- | |
||||
git config --local user.email "drone@crlf.wtf" |
||||
git config --local user.name "drone[bot]" |
||||
|
||||
git add ./http/assets/posts |
||||
|
||||
if [ -z "$(git status --porcelain)" ]; then |
||||
echo "::set-output name=push::false" |
||||
else |
||||
git commit -m "[SKIP CI] degraded newly added images" |
||||
echo "::set-output name=push::true" |
||||
git push origin main |
||||
fi |
||||
|
||||
- name: deploy |
||||
image: ruby:2.7 |
||||
depends_on: [build, degrade-images] |
||||
commands: |
||||
- apt update |
||||
- apt install rsync -y |
||||
- eval `ssh-agent -s` |
||||
- echo "$RSYNC_KEY" | ssh-add - |
||||
- mkdir -p ~/.ssh |
||||
- echo "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config |
||||
- rsync -rvc /drone/src/_http/ $RSYNC_USER@$RSYNC_HOST:$RSYNC_HTTP_PATH |
||||
- rsync -rvc /drone/src/_gopher/ $RSYNC_USER@$RSYNC_HOST:$RSYNC_GOPHER_PATH |
||||
environment: |
||||
RSYNC_KEY: |
||||
from_secret: rsync_key |
||||
RSYNC_USER: |
||||
from_secret: rsync_user |
||||
RSYNC_HOST: |
||||
from_secret: rsync_host |
||||
RSYNC_HTTP_PATH: |
||||
from_secret: rsync_http_path |
||||
RSYNC_GOPHER_PATH: |
||||
from_secret: rsync_gopher_path |
||||
|
||||
volumes: |
||||
- name: cache |
||||
host: |
||||
path: /tmp/cache |
Loading…
Reference in new issue