### Set up WireGuard Connection in GitHub Actions Workflow Source: https://context7.com/niklaskeerl/easy-wireguard-action/llms.txt Use this action to establish a WireGuard VPN tunnel. Provide your full WireGuard configuration as a GitHub secret named `WG_CONFIG_FILE`. ```yaml name: Deploy to Private Server on: push: branches: - main jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Set up WireGuard Connection uses: niklaskeerl/easy-wireguard-action@v2 with: WG_CONFIG_FILE: ${{ secrets.WG_CONFIG_FILE }} # Subsequent steps can now reach private network resources - name: SSH into private server run: ssh user@10.0.0.10 "cd /app && git pull && ./deploy.sh" - name: Run database migration on private DB run: | psql postgresql://user:pass@10.0.0.5:5432/mydb -f migrations/latest.sql ``` -------------------------------- ### Set up WireGuard Connection in GitHub Actions Source: https://github.com/niklaskeerl/easy-wireguard-action/blob/main/README.md Use this snippet in your GitHub Actions workflow to establish a WireGuard connection. It requires the WireGuard configuration to be provided via the secrets.WG_CONFIG_FILE. ```yaml name: Set up WireGuard Connection on: push: branches: - main jobs: wireguard: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Set up WireGuard Connection uses: niklaskeerl/easy-wireguard-action@v2 with: WG_CONFIG_FILE: ${{ secrets.WG_CONFIG_FILE }} ``` -------------------------------- ### Full Workflow: Connecting to a Private Docker Registry Source: https://context7.com/niklaskeerl/easy-wireguard-action/llms.txt This workflow demonstrates using the WireGuard action to access a private Docker registry. Ensure your WireGuard configuration and registry credentials are set as GitHub secrets. ```yaml name: Build and Push to Private Registry on: pull_request: branches: - main jobs: build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Establish WireGuard VPN Tunnel uses: niklaskeerl/easy-wireguard-action@v2 with: WG_CONFIG_FILE: ${{ secrets.WG_CONFIG_FILE }} - name: Log in to private Docker registry run: docker login registry.internal.example.com -u ${{ secrets.REGISTRY_USER }} -p ${{ secrets.REGISTRY_PASS }} - name: Build and push image run: | docker build -t registry.internal.example.com/myapp:${{ github.sha }} . docker push registry.internal.example.com/myapp:${{ github.sha }} ``` -------------------------------- ### Full Workflow: Integration Tests Against a Private API Source: https://context7.com/niklaskeerl/easy-wireguard-action/llms.txt This workflow shows how to run integration tests against a private API accessible via VPN. It uses a different WireGuard configuration secret (`STAGING_WG_CONFIG`) for the staging environment. ```yaml name: Integration Tests on: schedule: - cron: "0 4 * * *" # Nightly at 4 AM UTC workflow_dispatch: jobs: integration: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Connect to staging VPN uses: niklaskeerl/easy-wireguard-action@v2 with: WG_CONFIG_FILE: ${{ secrets.STAGING_WG_CONFIG }} - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: "20" - name: Install dependencies run: npm ci - name: Run integration tests run: npm run test:integration env: API_BASE_URL: http://10.0.0.20:3000 # Private staging API, reachable over VPN ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.