Skip to content

Commit

Permalink
ci: add deployment job
Browse files Browse the repository at this point in the history
  • Loading branch information
tyrone-sudeium committed Nov 25, 2022
1 parent 16ad77b commit 5f131af
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,25 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: COMMIT_SHA=${{ github.sha }}
deploy:
runs-on: ubuntu-latest
name: Deploy to Charon
needs: build
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
steps:
- name: Setup Tailscale
id: tailscale
uses: tailscale/github-action@main
with:
authkey: ${{ secrets.TAILSCALE_AUTHKEY }}
- name: Add SSH key
id: ssh_key
env:
SSH_KEY: ${{ secrets.CHARON_SSH_KEY }}
run: |
mkdir -p ~/.ssh
MACHINE_IP="$(tailscale ip -4 charon)"
ssh-keyscan $MACHINE_IP >> ~/.ssh/known-hosts
printf "%s" "$SSH_KEY" > ~/.ssh/key
chmod 600 ~/.ssh/key
ssh -i ~/.ssh/key tyrone@$MACHINE_IP ~/aethebot/restart.sh

0 comments on commit 5f131af

Please sign in to comment.