mirror of
https://github.com/PDP-10/its.git
synced 2026-02-27 01:09:49 +00:00
Deploy built images using rsync.
This commit is contained in:
7
.github/workflows/build.yml
vendored
7
.github/workflows/build.yml
vendored
@@ -8,6 +8,7 @@ defaults:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
environment: Deploy
|
||||
runs-on: ${{matrix.os}}
|
||||
strategy:
|
||||
matrix:
|
||||
@@ -22,3 +23,9 @@ jobs:
|
||||
run: sh -ex build/dependencies.sh install_linux
|
||||
- name: Build
|
||||
run: make check-dirs all EMULATOR=${{matrix.emulator}}
|
||||
- name: Deploy
|
||||
if: github.ref == 'refs/heads/master'
|
||||
env:
|
||||
SECRET: ${{secrets.SECRET}}
|
||||
EMULATOR: ${{matrix.emulator}}
|
||||
run: sh build/deploy.sh
|
||||
|
||||
@@ -1,5 +1,33 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Here we can do anything when deployment has finished."
|
||||
echo "Such as kicking off a second build stage."
|
||||
# At the $HOST, the $USER needs to have an .ssh directory with
|
||||
# authorized_keys matching $SECRET.
|
||||
|
||||
set -e
|
||||
|
||||
HOST=hactrn.org
|
||||
PORT=22
|
||||
USER=images
|
||||
DIR=/var/www/hactrn.org/images
|
||||
|
||||
SSH=$HOME/.ssh
|
||||
ID=$SSH/id_rsa
|
||||
|
||||
if test -z "$SECRET"; then
|
||||
echo 'ERROR: No key in $SECRET.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p $SSH
|
||||
chmod 700 $SSH
|
||||
echo "$SECRET" > $ID
|
||||
chmod 600 $ID
|
||||
|
||||
ssh-keyscan -p $PORT -H $HOST >> ~/.ssh/known_hosts
|
||||
|
||||
(cd out; tar czf $EMULATOR.tgz $EMULATOR)
|
||||
|
||||
echo "Deploying to $USER@$HOST:$PORT"
|
||||
rsync -av --inplace -e "ssh -p$PORT -l$USER" out/$EMULATOR.tgz $HOST:$DIR
|
||||
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user