Skip to content

Commit

Permalink
Update deploy-to-server.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
reteps authored Apr 23, 2024
1 parent 71647f3 commit fdcde7d
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/deploy-to-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,20 @@ jobs:
SSH_KEY_PATH: ${{ github.workspace }}/../private.key
- name: Check out repository code
uses: actions/checkout@v2
- name: Install openconnect
- name: Install OpenVPN
run: |
sudo apt update
sudo apt install -y openconnect
- name: Connect to university VPN & ssh in
sudo apt install openvpn openvpn-systemd-resolved
- name: Connect to OpenVPN server
run: |
echo "$OPENVPN_CONFIG" > ~/vpn.ovpn
sudo openvpn --config ~/vpn.ovpn --log "vpn.log" --daemon
sleep 15
env:
OPENVPN_CONFIG: ${{ secrets.OPENVPN_CONFIG }}

- name: Redeploy pwnybot
run: |
echo "$VPN_PASSWORD" | sudo openconnect --authgroup=1_SplitTunnel_Default --user=$VPN_USERNAME vpn.illinois.edu --passwd-on-stdin &
sleep 5
cat deploy.sh | ssh -i $SSH_KEY_PATH "$SERVER_USER@$SERVER_IP"
shell: bash
env:
Expand All @@ -36,3 +42,8 @@ jobs:
SSH_KEY_PATH: ${{ github.workspace }}/../private.key
SERVER_USER: ${{ secrets.SERVER_USER }}
SERVER_IP: ${{ secrets.SERVER_IP }}
- name: Kill VPN connection
if: always()
run: |
sudo chmod 777 vpn.log
sudo killall openvpn

0 comments on commit fdcde7d

Please sign in to comment.