This commit is contained in:
21
.github/workflows/deploy.yml
vendored
21
.github/workflows/deploy.yml
vendored
@@ -15,9 +15,20 @@ jobs:
|
|||||||
username: ${{ secrets.REMOTE_USER }}
|
username: ${{ secrets.REMOTE_USER }}
|
||||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
passphrase: ${{ secrets.SSH_PASSPHRASE }}
|
passphrase: ${{ secrets.SSH_PASSPHRASE }}
|
||||||
|
script_stop: true
|
||||||
script: |
|
script: |
|
||||||
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 }"
|
echo "=== Starting deployment ==="
|
||||||
powershell -Command "docker stop resume-frontend 2>$null; docker rm resume-frontend 2>$null; exit 0"
|
echo "=== Step 1: Clone/Update repo ==="
|
||||||
powershell -Command "Set-Location C:\projects\digital-resume-FE; docker build -t resume-frontend:latest ."
|
cd C:\projects\digital-resume-FE 2>nul && git pull origin main || (mkdir C:\projects 2>nul & cd C:\projects & git clone https://gitea.sashabayda.ca/Bayda77/digital-resume-FE.git)
|
||||||
powershell -Command "docker run -d --name resume-frontend --restart unless-stopped -p 3000:80 resume-frontend:latest"
|
echo "=== Step 2: Stop existing container ==="
|
||||||
powershell -Command "docker image prune -f"
|
docker stop resume-frontend 2>nul
|
||||||
|
docker rm resume-frontend 2>nul
|
||||||
|
echo "=== Step 3: Build Docker image ==="
|
||||||
|
cd C:\projects\digital-resume-FE
|
||||||
|
docker build -t resume-frontend:latest .
|
||||||
|
echo "=== Step 4: Run container ==="
|
||||||
|
docker run -d --name resume-frontend --restart unless-stopped -p 3000:80 resume-frontend:latest
|
||||||
|
echo "=== Step 5: Cleanup ==="
|
||||||
|
docker image prune -f
|
||||||
|
echo "=== Step 6: Verify ==="
|
||||||
|
docker ps -a --filter name=resume-frontend
|
||||||
|
|||||||
Reference in New Issue
Block a user