name: Deploy Portfolio
on:
  push:
    branches: [ "master" ]

jobs:
  deploy:
    runs-on: ubuntu-latest
    container:
      image: catthehacker/ubuntu:act-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Build and Deploy
        run: |
          docker build -t portfolio:latest .
          docker stop portfolio 2>/dev/null || true
          docker rm portfolio 2>/dev/null || true
          docker run -d --name portfolio -p 8081:80 portfolio:latest
