From db199cb313d67e1a614ff6adf80694c98bbc837c Mon Sep 17 00:00:00 2001 From: Lars Brinkhoff Date: Sat, 4 Mar 2023 10:19:34 +0100 Subject: [PATCH] Deploy images to kostersitz.com. To manage deploy secrets in GitHub, go to the repository page, click Settings, then Environments, then Deploy, then scroll down to Environment secrets. --- .github/workflows/build.yml | 2 ++ Makefile | 2 +- build/deploy-ftp.sh | 30 ++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 build/deploy-ftp.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5556a4392..41ac91506 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,4 +28,6 @@ jobs: if: github.ref == 'refs/heads/master' env: SECRET: ${{secrets.SECRET}} + FTP_SECRET: ${{secrets.FTP_SECRET}} EMULATOR: ${{matrix.emulator}} + run: sh build/deploy-ftp.sh diff --git a/Makefile b/Makefile index 93babfc9b..61bfb61ca 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ MCHN ?= DB endif endif -IMAGES=http://hactrn.org/images/ +IMAGES=http://hactrn.kostersitz.com/ include conf/network diff --git a/build/deploy-ftp.sh b/build/deploy-ftp.sh new file mode 100644 index 000000000..874d7ad8a --- /dev/null +++ b/build/deploy-ftp.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +set -e + +HOST="hactrn.kostersitz.com" +USER="hactrn@kostersitz.com" +DIR="images" +NETRC="$HOME/.netrc" + +if test -z "$FTP_SECRET"; then + echo 'ERROR: No password in $FTP_SECRET.' + exit 1 +fi + +echo "machine $HOST" > "$NETRC" +echo "login $USER" >> "$NETRC" +echo "password $FTP_SECRET" >> "$NETRC" +chmod 600 "$NETRC" + +echo "Deploying to $USER@$HOST" + +ftp "$HOST" <