A GitHub Actions composite action that sets up a WireGuard VPN connection on Ubuntu runners.
- name: Connect to VPN
uses: leukeleu/wireguard-connect@main
with:
WIREGUARD_CONFIG: ${{ secrets.WIREGUARD_CONFIG }}| Input | Required | Description |
|---|---|---|
WIREGUARD_CONFIG |
Yes | Full WireGuard configuration file contents (store this as a repository or organization secret) |
- Installs
wireguardandresolvconfviaapt - Writes the configuration to
/etc/wireguard/wg0.conf(mode600) - Brings up the tunnel with
wg-quick up wg0
- An Ubuntu runner (
ubuntu-*)
- Export a WireGuard configuration file from your VPN provider's dashboard
- Add the file contents as a secret named
WIREGUARD_CONFIGin your repository or organization settings - Add the action as a step before any steps that need VPN access:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Connect to VPN
uses: leukeleu/wireguard-connect@main
with:
WIREGUARD_CONFIG: ${{ secrets.WIREGUARD_CONFIG }}
- name: Deploy
run: ./deploy.sh