link the register and login pages to home page #25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Blissme Frontend | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - supuni-dev | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up SSH key | |
| run: | | |
| mkdir -p ~/.ssh | |
| echo "${{ secrets.EC2_SSH_KEY }}" > ~/.ssh/id_rsa | |
| chmod 600 ~/.ssh/id_rsa | |
| - name: Connect to EC2 and deploy | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{ secrets.EC2_HOST }} | |
| username: ubuntu | |
| key: ${{ secrets.EC2_SSH_KEY }} | |
| script: | | |
| cd blissme-app | |
| echo "🟢 Pulling latest code from GitHub..." | |
| git pull origin main | |
| echo "🟢 Building Docker image..." | |
| docker build -t frontend-app . | |
| echo "🟢 Stopping old container (if exists)..." | |
| docker stop frontend-app || true | |
| docker rm frontend-app || true | |
| echo "🟢 Running new container..." | |
| docker run -d -p 80:80 --name frontend-app frontend-app | |
| echo "✅ Frontend deployed successfully!" |