Skip to content

Commit db199cb

Browse files
committed
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.
1 parent 6638dbe commit db199cb

3 files changed

Lines changed: 33 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ jobs:
2828
if: github.ref == 'refs/heads/master'
2929
env:
3030
SECRET: ${{secrets.SECRET}}
31+
FTP_SECRET: ${{secrets.FTP_SECRET}}
3132
EMULATOR: ${{matrix.emulator}}
33+
run: sh build/deploy-ftp.sh

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ MCHN ?= DB
2525
endif
2626
endif
2727

28-
IMAGES=http://hactrn.org/images/
28+
IMAGES=http://hactrn.kostersitz.com/
2929

3030
include conf/network
3131

build/deploy-ftp.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
HOST="hactrn.kostersitz.com"
6+
USER="hactrn@kostersitz.com"
7+
DIR="images"
8+
NETRC="$HOME/.netrc"
9+
10+
if test -z "$FTP_SECRET"; then
11+
echo 'ERROR: No password in $FTP_SECRET.'
12+
exit 1
13+
fi
14+
15+
echo "machine $HOST" > "$NETRC"
16+
echo "login $USER" >> "$NETRC"
17+
echo "password $FTP_SECRET" >> "$NETRC"
18+
chmod 600 "$NETRC"
19+
20+
echo "Deploying to $USER@$HOST"
21+
22+
ftp "$HOST" <<EOF
23+
type image
24+
cd $DIR
25+
lcd out
26+
put $EMULATOR.tgz
27+
bye
28+
EOF
29+
30+
exit 0

0 commit comments

Comments
 (0)