File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ defaults:
88
99jobs :
1010 build :
11+ environment : Deploy
1112 runs-on : ${{matrix.os}}
1213 strategy :
1314 matrix :
2223 run : sh -ex build/dependencies.sh install_linux
2324 - name : Build
2425 run : make check-dirs all EMULATOR=${{matrix.emulator}}
26+ - name : Deploy
27+ if : github.ref == 'refs/heads/master'
28+ env :
29+ SECRET : ${{secrets.SECRET}}
30+ run : sh build/deploy.sh
Original file line number Diff line number Diff line change 11#! /bin/sh
22
3- echo " Here we can do anything when deployment has finished."
4- echo " Such as kicking off a second build stage."
3+ # At the $HOST, the $USER needs to have an .ssh directory with
4+ # authorized_keys matching $SECRET.
5+
6+ set -e
7+
8+ HOST=hactrn.org
9+ PORT=22
10+ USER=images
11+ DIR=/var/www/hactrn.org/images
12+
13+ SSH=$HOME /.ssh
14+ ID=$SSH /id_rsa
15+
16+ if test -z " $SECRET " ; then
17+ echo ' ERROR: No key in $SECRET.'
18+ exit 1
19+ fi
20+
21+ mkdir -p $SSH
22+ chmod 700 $SSH
23+ echo " $SECRET " > $ID
24+ chmod 600 $ID
25+
26+ ssh-keyscan -p $PORT -H $HOST >> ~ /.ssh/known_hosts
27+
28+ echo " Deploying to $USER @$HOST :$PORT "
29+ rsync -av --inplace -e " ssh -p$PORT -l$USER " out $HOST :$DIR
30+
531exit 0
You can’t perform that action at this time.
0 commit comments