Skip to content

Commit dbd1ef8

Browse files
git commit -m 'testing'
1 parent e5eeca1 commit dbd1ef8

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.github/workflows/autodeploy.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,20 @@ jobs:
112112
run: |
113113
ssh -i private_key -o StrictHostKeyChecking=no ${{ secrets.GCP_USERNAME }}@${{ secrets.GCP_VM_IP }} << 'EOF'
114114
cd /home/masahisasekita/term-group-project-c01w25-project-course-matrix || { echo "Error: Directory /root/myapp does not exist!"; exit 1; }
115+
116+
sudo docker rmi -f $(sudo docker images -q)
117+
sudo docker system prune -a --volumes -f
115118
116119
# Pull the latest images
117120
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/course-matrix-frontend:master
118121
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/course-matrix-backend:master
119122
123+
# Run the frontend container
124+
docker run -d -p 5173:5173 ${{ secrets.DOCKERHUB_USERNAME }}/course-matrix-frontend:master
125+
126+
# Run the backend container
127+
docker run -d -p 8081:8081 ${{ secrets.DOCKERHUB_USERNAME }}/course-matrix-backend:master
128+
120129
# Stop and remove existing containers
121130
docker compose down
122131

course-matrix/frontend/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ RUN npm install
1414
COPY . .
1515

1616
# Expose the frontend port
17+
EXPOSE 8081
1718
EXPOSE 5173
1819

1920
# Start the application

0 commit comments

Comments
 (0)