Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jsimonclark committed May 14, 2024
2 parents ca35602 + 46a54ba commit 4fd0f38
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy

on:
push:
branches:
- main

env:
SSH_USER: lhendrix
SSH_HOST: 51.68.188.78

jobs:
deploy:
name: Deploy streamlit app
runs-on: ubuntu-latest

steps:
- name: Install SSH keys
run: |
mkdir -p ~/.ssh
echo "${{ secrets.ACTIONS_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H ${{ env.SSH_HOST }} >> ~/.ssh/known_hosts
- name: Test SSH Connection
run: ssh -o StrictHostKeyChecking=no ${{ env.SSH_USER }}@${{ env.SSH_HOST }} "echo SSH connection successful"
- name: Pull Changes from Repository
run: |
ssh ${{ env.SSH_USER }}@${{ env.SSH_HOST }} "cd /home/lhendrix/big-map-graph && git pull"
- name: Restart Streamlit Server
run: |
ssh ${{ env.SSH_USER }}@${{ env.SSH_HOST }} "echo '${{ secrets.SUDO_PASSWORD }}' | sudo -S nohup /home/lhendrix/big-map-graph/venv/bin/streamlit run --server.port 443 /home/lhendrix/big-map-graph/app.py > /dev/null 2>&1 &"

0 comments on commit 4fd0f38

Please sign in to comment.