File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed
Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -61,22 +61,20 @@ jobs:
6161 - name : Build Docker Image
6262 run : |
6363 cd course-matrix
64- # Build the frontend image
65- docker compose -f docker-compose.yml build frontend
66- docker tag frontend:latest course-matrix/frontend:latest # Tag frontend with the Docker Hub repository
67-
68- # Build the backend image
69- docker compose -f docker-compose.yml build backend
70- docker tag backend:latest course-matrix/backend:latest # Tag backend with the Docker Hub repository
64+ docker compose build
65+
66+ - name : Tag Images
67+ run : |
68+ docker tag course-matrix/frontend:latest course-matrix/frontend:${{ github.sha }}
69+ docker tag course-matrix/backend:latest course-matrix/backend:${{ github.sha }}
7170
7271 # Step 5: Push Docker images to Docker Hub
7372 - name : Push Docker images to Docker Hub
7473 run : |
75- # Push the frontend image
7674 docker push course-matrix/frontend:latest
77-
78- # Push the backend image
75+ docker push course-matrix/frontend:${{ github.sha }}
7976 docker push course-matrix/backend:latest
77+ docker push course-matrix/backend:${{ github.sha }}
8078
8179 deploy :
8280 needs : test
9593 run : |
9694 ssh -i private_key -o StrictHostKeyChecking=no ${{ secrets.GCP_USERNAME }}@${{ secrets.GCP_VM_IP }} << 'EOF'
9795 cd /home/masahisasekita/term-group-project-c01w25-project-course-matrix || { echo "Error: Directory /root/myapp does not exist!"; exit 1; }
98- git pull ms/Scrun-130-Project-Deployment-dockerfiles
96+ git pull develop
9997 cd course-matrix
10098
10199 # Update frontend .env
You can’t perform that action at this time.
0 commit comments