Skip to content

Commit

Permalink
[feat] auto deploy on AWS (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
seqre committed Feb 24, 2023
1 parent a281c5e commit 79253eb
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
jobs:
build:
strategy:
fail-fast: false
fail-fast: true
matrix:
target: ["x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl"]
runs-on: ubuntu-latest
Expand Down Expand Up @@ -49,6 +49,7 @@ jobs:

publish:
runs-on: ubuntu-latest
needs: ['build']
steps:
- name: Checkout source
uses: actions/checkout@v3
Expand All @@ -68,3 +69,27 @@ jobs:
run: cargo publish --token ${CRATES_IO_TOKEN}
env:
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}

aws_deploy:
runs-on: ubuntu-latest
needs: ['build']
steps:
- name: Configure SSH
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/private.key
chmod 600 ~/.ssh/private.key
cat >>~/.ssh/config <<END
Host aws
HostName $SSH_HOST
User $SSH_USER
IdentityFile ~/.ssh/private.key
StrictHostKeyChecking no
END
env:
SSH_USER: ${{ secrets.AWS_USERNAME }}
SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_HOST: ${{ secrets.AWS_HOST }}

- name: Update secubot on server
run: ssh aws 'cd /opt/secubot && ./secupdate'

0 comments on commit 79253eb

Please sign in to comment.