name: Quick Deploy on: push: branches: [ main ] workflow_dispatch: env: NODE_VERSION: '20' DOCKER_IMAGE: portfolio-app CONTAINER_NAME: portfolio-app jobs: quick-deploy: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} cache: 'npm' - name: Install dependencies run: npm ci - name: Build application run: npm run build - name: Build Docker image run: | docker build -t ${{ env.DOCKER_IMAGE }}:latest . - name: Stop existing container run: | docker stop ${{ env.CONTAINER_NAME }} || true docker rm ${{ env.CONTAINER_NAME }} || true - name: Start new container run: | docker run -d \ --name ${{ env.CONTAINER_NAME }} \ --restart unless-stopped \ -p 3000:3000 \ -e NODE_ENV=production \ ${{ env.DOCKER_IMAGE }}:latest - name: Health check run: | sleep 10 curl -f http://localhost:3000/api/health echo "✅ Quick deployment successful!"