2023-10-01 10:39:17 +02:00
|
|
|
kind: pipeline
|
|
|
|
name: default
|
|
|
|
type: docker
|
|
|
|
|
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: arm64
|
|
|
|
|
|
|
|
clone:
|
|
|
|
skip_verify: true
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: restore-cache
|
|
|
|
privileged: true
|
|
|
|
pull: always
|
|
|
|
image: 2martens/drone-volume-cache
|
|
|
|
settings:
|
|
|
|
restore: true
|
|
|
|
mount:
|
|
|
|
- ./node_modules
|
|
|
|
volumes:
|
|
|
|
- name: cache
|
|
|
|
path: /cache
|
|
|
|
- name: build
|
|
|
|
pull: always
|
|
|
|
image: node:18-alpine
|
|
|
|
commands:
|
|
|
|
- npm install
|
|
|
|
- npm run build:production
|
2023-10-26 23:12:00 +02:00
|
|
|
- cp /drone/src/.htaccess /drone/src/dist/www/
|
2023-10-01 10:39:17 +02:00
|
|
|
- name: rebuild-cache
|
|
|
|
privileged: true
|
|
|
|
image: 2martens/drone-volume-cache
|
|
|
|
settings:
|
|
|
|
rebuild: true
|
|
|
|
mount:
|
|
|
|
- ./node_modules
|
|
|
|
volumes:
|
|
|
|
- name: cache
|
|
|
|
path: /cache
|
|
|
|
- name: deploy
|
|
|
|
pull: always
|
|
|
|
image: 2martens/drone-rsync
|
|
|
|
settings:
|
|
|
|
hosts: [ "gienah.uberspace.de" ]
|
|
|
|
user: wahlfron
|
2023-10-26 23:12:00 +02:00
|
|
|
source: /drone/src/dist/www/.
|
2023-10-01 10:39:17 +02:00
|
|
|
target: ~/tmp/build
|
|
|
|
recursive: true
|
|
|
|
delete: true
|
|
|
|
port: 22
|
|
|
|
key:
|
|
|
|
from_secret: rsync_key
|
|
|
|
script:
|
|
|
|
- shopt -s dotglob
|
|
|
|
- rm -rf tmp/old.build
|
|
|
|
- mkdir tmp/old.build
|
|
|
|
- cp -r html/* tmp/old.build/
|
|
|
|
- rm -rf html/*
|
|
|
|
- cp -r tmp/build/* html/
|
|
|
|
- rm -rf tmp/build
|
|
|
|
- name: notify
|
|
|
|
pull: always
|
|
|
|
image: 2martens/drone-email
|
|
|
|
environment:
|
|
|
|
EMAIL_USERNAME:
|
|
|
|
from_secret: email_username
|
|
|
|
EMAIL_PASSWORD:
|
|
|
|
from_secret: email_password
|
|
|
|
settings:
|
|
|
|
host: howell.uberspace.de
|
|
|
|
port: 587
|
|
|
|
from: Drone <drone@2martens.de>
|
|
|
|
secrets: [email_username, email_password]
|
|
|
|
when:
|
|
|
|
status: [ failure ]
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
- name: cache
|
|
|
|
host:
|
|
|
|
path: /var/lib/drone/cache
|
|
|
|
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
branch:
|
|
|
|
- main
|