Skip to content

ci: add pipeline

ci: add pipeline #3

Workflow file for this run

name: Frontend Deploy
on:
push:
branches:
- setup
- main
jobs:
deploy:

Check failure on line 10 in .github/workflows/frontend-cd.yml

View workflow run for this annotation

GitHub Actions / Frontend Deploy

Invalid workflow file

The workflow is not valid. .github/workflows/frontend-cd.yml (Line: 10, Col: 3): The workflow must contain at least one job with no dependencies.
runs-on: ubuntu-latest
needs: [test-and-build]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: next-build
path: .next
if-no-files-found: error
include-hidden-files: true
compression-level: 6
overwrite: false
- name: Install sshpass
run: sudo apt-get install -y sshpass
- name: Deploy to Production Server
run: |
echo "🚀 Deploying .next build to server..."
sshpass -p "${{ secrets.SERVER_PASSWORD }}" scp -o StrictHostKeyChecking=no -r .next package.json pnpm-lock.yaml \
"${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }}:/home/${{ secrets.SERVER_USER }}/AI-Ad-Gen-Frontend"
- name: Start Application on Server
run: |
sshpass -p "${{ secrets.SERVER_PASSWORD }}" ssh -o StrictHostKeyChecking=no \
"${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }}" << 'EOF'
set -e # Stop script on error
cd /home/${{ secrets.SERVER_USER }}/AI-Ad-Gen-Frontend
pnpm install --frozen-lockfile
pm2 delete ai-adgen-frontend || true
pm2 start pnpm --name ai-adgen-frontend -- start
EOF