-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (29 loc) · 1.5 KB
/
RDP.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: RDP
on:
workflow_dispatch:
jobs:
setup-rdp-tunnel:
runs-on: windows-latest
steps:
- name: Check out the repository
uses: actions/checkout@v2
- name: Download and Install Playit
run: |
Invoke-WebRequest -Uri "https://github.com/playit-cloud/playit-agent/releases/download/v0.15.26/playit-windows-x86_64-signed.exe" -OutFile "$env:USERPROFILE\playit.exe"
Start-Sleep -Seconds 5 # Give some time for the download to complete
# Default, optional.
- name: Enable TS
run: Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0
- run: Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
- run: Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "UserAuthentication" -Value 1
- run: Set-LocalUser -Name "runneradmin" -Password (ConvertTo-SecureString -AsPlainText "Tuffuhq0@" -Force)
- name: Start Playit and Set Up RDP Tunnel
env:
PLAYIT_AUTH_KEY: f375818923068a499e4b92d95f1a86072666dca741de60cd31218275f7f89d56
run: |
Start-Process -FilePath "$env:USERPROFILE\playit.exe" -ArgumentList "--secret $env:PLAYIT_AUTH_KEY" -NoNewWindow -Wait
Start-Process -FilePath "$env:USERPROFILE\playit.exe" -NoNewWindow
# Prevent workflow to stop
- name: Keep the GitHub Action Runner Alive
run: |
Start-Sleep -Seconds 11800 # Adjust the duration based on your needs