Skip to content

Commit b2988d8

Browse files
ci: move wireguard ip to github variable
This allows us to update the IP if necessary without having to make changes to the workflow file.
1 parent 5021001 commit b2988d8

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

.github/actions/deploy/action.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ inputs:
99
environment:
1010
description: The environment to deploy to (development/production)
1111
required: true
12+
expected-ip:
13+
description: The expected public IP address after establishing the VPN connection
14+
required: true
1215
mantle-aws-access-key-id:
1316
description: Mantle AWS Access Key ID
1417
required: true
@@ -33,24 +36,18 @@ runs:
3336
with:
3437
name: place
3538

36-
- name: Debug
37-
run: |
38-
response=$(curl -s 'https://httpbin.org/ip')
39-
echo "Current IP: $(echo $response | jq -r '.origin')"
40-
shell: bash
41-
4239
- name: Establish WireGuard VPN Connection
43-
uses: niklaskeerl/easy-wireguard-action@v2
40+
uses: niklaskeerl/easy-wireguard-action@fdecd3aabde0060ec80f89aa03070ae0705fedba # v2
4441
with:
4542
WG_CONFIG_FILE: ${{ inputs.secret }}
4643

4744
- name: Poll for IP Change
4845
run: |
4946
elapsed=0
5047
while true; do
51-
response=$(curl -s 'https://httpbin.org/ip')
48+
response=$(curl -s 'https://httpbin.org/ip' || echo '{"origin":""}')
5249
content=$(echo $response | jq -r '.origin')
53-
if [ "$content" == "20.68.48.98" ]; then
50+
if [ "$content" == "${{ vars.EXPECTED_IP }}" ]; then
5451
break
5552
fi
5653
if [ $elapsed -ge 20 ]; then

0 commit comments

Comments
 (0)