From b6aba842c46f5df70b0a3ad1fc825ca3ad92256e Mon Sep 17 00:00:00 2001 From: Luke Ceddia Date: Sun, 5 Jan 2020 00:40:05 +1100 Subject: [PATCH] Add ssh deployment --- .ci/common-exclusion.list | 10 ++++++++++ .ci/deploy.sh | 17 +++++++++++++++++ .ci/lnx-exclusion.list | 3 +++ .github/workflows/build.yml | 14 ++++++++++++++ 4 files changed, 44 insertions(+) create mode 100644 .ci/common-exclusion.list create mode 100644 .ci/deploy.sh create mode 100644 .ci/lnx-exclusion.list diff --git a/.ci/common-exclusion.list b/.ci/common-exclusion.list new file mode 100644 index 000000000..3dcf24d39 --- /dev/null +++ b/.ci/common-exclusion.list @@ -0,0 +1,10 @@ +.ci +.travis +.travis.yml +appveyor.yml +.git +.gitignore +setup_win.bat +qb64/internal/c/mingw32 +qb64/internal/c/mingw64 +autosync.sh diff --git a/.ci/deploy.sh b/.ci/deploy.sh new file mode 100644 index 000000000..4f58c9cd8 --- /dev/null +++ b/.ci/deploy.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +TZ=UTC now=`date +"%F-%H-%M-%S"` +filename="/tmp/qb64_${now}_`echo ${GITHUB_SHA} | sed 's/\(.......\).*$/\1/'`_lnx.tar.gz" +cd .. +tar --create --auto-compress --file ${filename} --exclude-from=qb64/.ci/common-exclusion.list --exclude-from=qb64/.ci/lnx-exclusion.list qb64 + +# Send to server +# Sometimes the connection can be a bit flakey, so try multiple times on error +for i in `seq 1 10` +do scp ${filename} remote-server:autobuilds/development/ + if [ "$?" -eq 0 ] + then exit 0 + fi + echo scp $i failed +done + diff --git a/.ci/lnx-exclusion.list b/.ci/lnx-exclusion.list new file mode 100644 index 000000000..16a8f91df --- /dev/null +++ b/.ci/lnx-exclusion.list @@ -0,0 +1,3 @@ +setup_osx.command +internal/c/c_compiler +qb64_start_osx.command diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fb6230735..32efaf20e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,3 +24,17 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} branch: githubactions + - name: Set deployment SSH key + if: github.event_name == 'push' + uses: shimataro/ssh-key-action@v1 + with: + private-key: ${{ secrets.SSH_KEY }} + public-key: ${{ secrets.SSH_KEY_PUBLIC }} + known-hosts: "qb64.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAtmlTks7NPQHwvQiW+P2P8voWXfwYD+EuU39ERiaVw5g/lG/6pU1SKdrRBg2AtaPToPgK/nQyaid3sO2aWO00ixiKB3JPJoVp3nRY8YFi/AtVtVot/xh6+39fjP59tMCnMCbXTKjyMWL0kkwzd+OT8wryRZ/EgjK3vk9UGYzxKSr8G/KKV3GBDrJOdpHT2gNUcDFg6HSMvM860ZOF8n6jKRwp7MM0SpptufuQDgj/LhHcqQtFOqkhW9HXNmZR7IPchb5tsUubbPdSLu043B0ir2x5sCkK9V+inZExPg7KwIZ0yRsSv5esgLaBdyf1UToU3LU4ZM1hWjcJsp2fCBRkhw==" + config: | + Host remote-server + HostName qb64.org + User m6rosupy1q2t + - name: Package and deploy + if: github.event_name == 'push' + run: .ci/deploy.sh