From 78ddb4dee8be23ff853ec5db2243bde0381c9f37 Mon Sep 17 00:00:00 2001 From: Thomas Gardner <63060567+cdecde57@users.noreply.github.com> Date: Sat, 13 Dec 2025 13:19:05 -0700 Subject: [PATCH] Remove AWS EC2 deployment step (so we have the 2 pipeline requirement) Removed the optional deployment step to AWS EC2 from the CI/CD workflow. --- .github/workflows/ci-cd.yml | 57 ------------------------------------- 1 file changed, 57 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 4bd2a27..ccb8ffb 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -140,60 +140,3 @@ jobs: labels: ${{ steps.meta-backend.outputs.labels }} cache-from: type=registry,ref=shawnjensen/devops-group-c-fall2025-backend:buildcache cache-to: type=registry,ref=shawnjensen/devops-group-c-fall2025-backend:buildcache,mode=max - - # Deploy to AWS EC2 (optional, triggered manually or after successful build) - deploy-to-ec2: - runs-on: ubuntu-latest - needs: [build-and-push] - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-session-token: ${{ secrets.AWS_SESSION_TOKEN }} - aws-region: us-west-2 - - - name: Deploy to EC2 via SSH - uses: appleboy/ssh-action@v1.0.0 - with: - host: ${{ secrets.EC2_HOST }} - username: ${{ secrets.EC2_USERNAME }} - key: ${{ secrets.EC2_SSH_KEY }} - script: | - # Pull latest images - docker pull shawnjensen/devops-group-c-fall2025-frontend:latest - docker pull shawnjensen/devops-group-c-fall2025-backend:latest - - # Stop and remove old containers - docker stop frontend backend || true - docker rm frontend backend || true - - # Run new containers - docker run -d \ - --name backend \ - -p 5000:5000 \ - -e SUPABASE_URL=${{ secrets.SUPABASE_URL }} \ - -e SUPABASE_KEY=${{ secrets.SUPABASE_KEY }} \ - -e PORT=${{ secrets.PORT }} \ - shawnjensen/devops-group-c-fall2025-backend:latest - - docker run -d \ - --name frontend \ - -p 80:80 \ - -e REACT_APP_BACKEND_URL=http://localhost:5000 \ - shawnjensen/devops-group-c-fall2025-frontend:latest - - # Clean up old images - docker image prune -af - - - name: Verify deployment - run: | - echo "Deployment completed successfully!" - echo "Frontend should be available at: http://${{ secrets.EC2_HOST }}" - echo "Backend should be available at: http://${{ secrets.EC2_HOST }}:5000"