1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-03 10:01:21 +00:00

Add aws action

This commit is contained in:
Luke Ceddia 2021-02-01 20:47:45 +11:00
parent b28a929d50
commit 46c8f9fe84
No known key found for this signature in database
GPG key ID: 319344384A0759B0
2 changed files with 14 additions and 23 deletions

View file

@ -2,18 +2,13 @@
OS=$1 OS=$1
TZ=UTC now=`date +"%F-%H-%M-%S"` TZ=UTC now=`date +"%F-%H-%M-%S"`
filename="/tmp/qb64_${now}_`echo ${GITHUB_SHA} | sed 's/\(.......\).*$/\1/'`_$OS.tar.gz" BUCKET=qb64-dev-builds
filename="/tmp/qb64_${now}_`echo ${GITHUB_SHA} | sed 's/\(.......\).*$/\1/'`_${OS}.tar.gz"
cd .. cd ..
tar --create --auto-compress --file ${filename} --exclude-from=qb64/.ci/common-exclusion.list --exclude-from=qb64/.ci/$OS-exclusion.list qb64 tar --create --auto-compress --file ${filename} --exclude-from=qb64/.ci/common-exclusion.list --exclude-from=qb64/.ci/$OS-exclusion.list qb64
# Send to server current_files=$(aws --output text --query 'Contents[].Key' s3api list-objects --bucket ${BUCKET} --prefix ${OS})
# Sometimes the connection can be a bit flakey, so try multiple times on error aws s3 cp ${filename} s3://${BUCKET}/${OS}/
for i in `seq 1 10` for f in current_files; do
do scp ${filename} remote-server:autobuilds/development/ aws s3 rm s3://${BUCKET}/$f
if [ "$?" -eq 0 ]
then exit 0
fi
echo scp $i failed
done done
exit 1

View file

@ -7,7 +7,7 @@ on:
jobs: jobs:
linux-build: linux-build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: "contains(github.event.head_commit.message, 'ci-skip')" if: "!contains(github.event.head_commit.message, 'ci-skip')"
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install dependencies - name: Install dependencies
@ -25,18 +25,14 @@ jobs:
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
branch: development branch: development
- name: Set deployment SSH key - name: Setup aws
if: github.event_name == 'push' if: github.event_name == 'push'
uses: shimataro/ssh-key-action@v2.1.0 uses: aws-actions/configure-aws-credentials@v1
with: with:
key: ${{ secrets.SSH_KEY }} aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# "qb64.org ssh-rsa AAAA" etc. aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }} aws-region: us-east-2
config: | - name: Publish to S3
Host remote-server
HostName qb64.org
User m6rosupy1q2t
- name: Package and deploy
if: github.event_name == 'push' if: github.event_name == 'push'
run: .ci/deploy.sh lnx run: .ci/deploy.sh lnx
@ -90,7 +86,7 @@ jobs:
windows-x64-build: windows-x64-build:
runs-on: windows-latest runs-on: windows-latest
if: "!contains(github.event.head_commit.message, 'ci-skip')" if: "contains(github.event.head_commit.message, 'ci-skip')"
env: env:
PLATFORM: x64 PLATFORM: x64
steps: steps: