Skip to content

Commit

Permalink
Merge branch 'deploy-action'
Browse files Browse the repository at this point in the history
  • Loading branch information
johnjcamilleri committed Apr 15, 2020
2 parents dc05eb5 + d644287 commit eed1f80
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/vpn/config.ovpn
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
remote stu.vpn.um.edu.mt 443 tcp-client
nobind
dev tun
compress lzo
pull
tls-client
resolv-retry infinite
mute-replay-warnings
cipher BF-CBC
mute 20
comp-lzo

ca ca.crt
cert user.crt
key user.key
3 changes: 3 additions & 0 deletions .github/vpn/config.ssh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Host 10.249.1.100
StrictHostKeyChecking no
User john
42 changes: 42 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy to MLRS
on:
push:
branches:
- deploy-action
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Install Open VPN
run: sudo apt-get install openvpn

- name: Connect VPN
uses: golfzaptw/action-connect-ovpn@master
id: connect_vpn
with:
FILE_OVPN: '.github/vpn/config.ovpn'
env:
CA_CRT: ${{ secrets.CA_CRT }}
USER_CRT: ${{ secrets.USER_CRT }}
USER_KEY: ${{ secrets.USER_KEY }}

- name: Check Connect VPN
run: echo ${{ steps.connect_vpn.outputs.STATUS }}

- name: Setup SSH
run: |
mkdir -p ~/.ssh
chmod 700 ~/.ssh
cp .github/vpn/config.ssh ~/.ssh/config
chmod 600 ~/.ssh/config
cat > ~/.ssh/id_rsa <<< "${{ secrets.SSH_PRIVATE_KEY }}"
chmod 600 ~/.ssh/id_rsa
- name: Run deploy script
run: ./deploy.sh

- name: Close VPN
if: always()
run: sudo killall openvpn

0 comments on commit eed1f80

Please sign in to comment.