Skip to content

Create Jhjj #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions Jhjj
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Windows Cloud PC - Anydesk (Optimized)

on:
workflow_dispatch:

jobs:
build:
name: Start Building...
runs-on: windows-latest
timeout-minutes: 10080 # Máximo de 7 dias para evitar tempo de execução excessivo

steps:
- name: Downloading & Installing Essentials
run: |
# Baixa o arquivo .bat para instalar componentes essenciais
Invoke-WebRequest -Uri "https://www.dropbox.com/scl/fi/7eiczvgil84czu55dxep3/Downloads.bat?rlkey=wzdc1wxjsph2b7r0atplmdz3p&dl=1" -OutFile "Downloads.bat"
# Executa o script .bat para instalar os componentes
cmd /c Downloads.bat

- name: Log In To AnyDesk
run: |
# Verifica se o arquivo start.bat existe antes de executar
if (Test-Path "start.bat") {
cmd /c start.bat
} else {
Write-Host "Arquivo start.bat não encontrado. Verifique a configuração."
}

- name: Monitor and Restart AnyDesk if Needed
run: |
# Monitora a conexão do AnyDesk e reinicia se necessário
while ($true) {
$process = Get-Process -Name "AnyDesk" -ErrorAction SilentlyContinue
if (-not $process) {
Write-Host "AnyDesk não está rodando, reiniciando..."
cmd /c start.bat
}
Start-Sleep -Seconds 300 # Verifica a cada 5 minutos
}

- name: Time Counter (Long Running Task)
run: |
# Configura para manter a máquina em execução
Start-Sleep -Seconds 604800 # 7 dias de execução contínua

- name: Clean Up Temporary Files
if: success() # Executa esta etapa apenas se todas as etapas anteriores forem bem-sucedidas
run: |
# Remove arquivos temporários ou logs gerados
Remove-Item Downloads.bat -Force
Write-Host "Limpeza completa."