fix: network detection #103
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python Tests | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
itsUP: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install and activate venv | |
run: python -m venv .venv | |
- name: Install dependencies | |
run: bin/requirements-update.sh | |
- name: Run checks | |
run: | | |
bin/format.sh | |
bin/lint.sh | |
bin/test.sh | |
- name: Install OpenVPN | |
run: | | |
sudo apt update | |
sudo apt install -y openvpn openvpn-systemd-resolved | |
- name: Connect to VPN | |
uses: 'Morriz/github-openvpn-connect-action@v3' | |
with: | |
config_file: .github/workflows/client.ovpn | |
host: ${{ secrets.API_HOST }} | |
ca: '${{ secrets.OVPN_CA }}' | |
cert: '${{ secrets.OVPN_CERT }}' | |
client_key: '${{ secrets.OVPN_USER_KEY }}' | |
client_pass: '${{ secrets.OVPN_USER_PASS }}' | |
tls_auth_key: '${{ secrets.OVPN_TLS_AUTH_KEY }}' | |
- name: Use SSH | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USERNAME }} | |
key: '${{ secrets.SSH_PRIVATE_KEY }}' | |
passphrase: '${{ secrets.SSH_PASSPHRASE }}' | |
script: | | |
curl -v 'https://${{ secrets.API_HOST }}/update-upstream/itsUP?apikey=${{ secrets.API_KEY }}' | |
exit |