Skip to content

Commit

Permalink
Deploy images to kostersitz.com.
Browse files Browse the repository at this point in the history
To manage deploy secrets in GitHub, go to the repository page, click
Settings, then Environments, then Deploy, then scroll down to
Environment secrets.
  • Loading branch information
larsbrinkhoff committed Mar 6, 2023
1 parent 6638dbe commit db199cb
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ MCHN ?= DB
endif
endif

IMAGES=http://hactrn.org/images/
IMAGES=http://hactrn.kostersitz.com/

include conf/network

Expand Down
30 changes: 30 additions & 0 deletions build/deploy-ftp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh

set -e

HOST="hactrn.kostersitz.com"
USER="[email protected]"
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" <<EOF
type image
cd $DIR
lcd out
put $EMULATOR.tgz
bye
EOF

exit 0

0 comments on commit db199cb

Please sign in to comment.