test commands: split
Some checks failed
Deploy to Production / deploy (push) Failing after 5s

This commit is contained in:
2026-01-04 04:24:46 -06:00
parent 418014fb04
commit 169a6c213e

View File

@@ -8,34 +8,52 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy to Windows Machine
- name: Clone or Update Repository
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
passphrase: ${{ secrets.SSH_PASSPHRASE }}
script_shell: pwsh
script: |
if (Test-Path "C:\projects\digital-resume-FE") {
Set-Location C:\projects\digital-resume-FE
git pull origin main
} else {
New-Item -ItemType Directory -Path C:\projects -Force
Set-Location C:\projects
git clone https://gitea.sashabayda.ca/Bayda77/digital-resume-FE.git
Set-Location digital-resume-FE
}
$container = docker ps -a -q -f name=resume-frontend
if ($container) {
docker stop resume-frontend
Start-Sleep -Seconds 2
docker rm resume-frontend
}
docker build -t resume-frontend:latest .
docker run -d --name resume-frontend --restart unless-stopped -p 3000:80 resume-frontend:latest
docker image prune -f
powershell -Command "if (Test-Path 'C:\projects\digital-resume-FE') { Set-Location C:\projects\digital-resume-FE; git pull origin main } else { New-Item -ItemType Directory -Path C:\projects -Force; Set-Location C:\projects; git clone https://gitea.sashabayda.ca/Bayda77/digital-resume-FE.git; Set-Location digital-resume-FE }"
- name: Stop and Remove Existing Container
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
passphrase: ${{ secrets.SSH_PASSPHRASE }}
script: |
powershell -Command "$container = docker ps -a -q -f name=resume-frontend; if ($container) { docker stop resume-frontend; Start-Sleep -Seconds 2; docker rm resume-frontend }"
- name: Build Docker Image
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
passphrase: ${{ secrets.SSH_PASSPHRASE }}
script: |
powershell -Command "Set-Location C:\projects\digital-resume-FE; docker build -t resume-frontend:latest ."
- name: Run Docker Container
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
passphrase: ${{ secrets.SSH_PASSPHRASE }}
script: |
powershell -Command "docker run -d --name resume-frontend --restart unless-stopped -p 3000:80 resume-frontend:latest"
- name: Cleanup Unused Images
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
passphrase: ${{ secrets.SSH_PASSPHRASE }}
script: |
powershell -Command "docker image prune -f"