From 5de7d8c485b5fab803d4efdbfbcc2819afb1c5ab Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 11 Nov 2022 22:01:57 +0100 Subject: [PATCH] ci: rsync dist/ over to the live server this is a quick&dirty solution to update the live server whenever a git tag on master matching v* pattern is pushed. a longer term permanent idea is to use a nostr relay to push notifications about new releases. --- .woodpecker.yml | 10 ++++++++++ tools/ci-rsync-release.sh | 6 ++++++ 2 files changed, 16 insertions(+) create mode 100755 tools/ci-rsync-release.sh diff --git a/.woodpecker.yml b/.woodpecker.yml index 50e2deb..d52a743 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -24,3 +24,13 @@ pipeline: base_url: https://git.qcode.ch files: nostrweb.tar.gz note: "automated release by ${CI_SYSTEM_HOST} \nbuild id: ${CI_BUILD_NUMBER}" + rsync_dist: + when: + branch: master + event: tag + tag: v* + image: alpine:3.16.2 + secrets: [releaser_ssh_key] + commands: + - apk add --no-cache --quiet openssh-client rsync + - tools/ci-rsync-release.sh diff --git a/tools/ci-rsync-release.sh b/tools/ci-rsync-release.sh new file mode 100755 index 0000000..67833ad --- /dev/null +++ b/tools/ci-rsync-release.sh @@ -0,0 +1,6 @@ +#!/bin/sh +set -e +printenv RELEASER_SSH_KEY > .sshkey +chmod 0600 .sshkey +sshcmd='ssh -i .sshkey -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' +exec rsync -vrz -e "$sshcmd" dist/* nostrreleaser@nostr.ch:/var/www/nostr/