File tree Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Push Docker Images
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+
7+ jobs :
8+ build-and-push :
9+ runs-on : ubuntu-latest
10+ permissions :
11+ contents : read
12+ packages : write
13+
14+ steps :
15+ - name : Checkout repo
16+ uses : actions/checkout@v3
17+
18+ - name : Log in to GitHub Container Registry
19+ uses : docker/login-action@v2
20+ with :
21+ registry : ghcr.io
22+ username : ${{ github.actor }}
23+ password : ${{ secrets.GITHUB_TOKEN }}
24+
25+ - name : Build and push server image
26+ uses : docker/build-push-action@v5
27+ with :
28+ context : ./server
29+ file : ./server/Dockerfile
30+ push : true
31+ tags : ghcr.io/${{ github.repository }}/server:latest
32+
33+ - name : Build and push client image
34+ uses : docker/build-push-action@v5
35+ with :
36+ context : ./client
37+ file : ./client/Dockerfile
38+ push : true
39+ tags : ghcr.io/${{ github.repository }}/client:latest
Original file line number Diff line number Diff line change @@ -3,5 +3,6 @@ WORKDIR /app
33COPY package*.json ./
44RUN npm ci
55COPY . .
6+ RUN npm run build
67EXPOSE 3000
78CMD ["npm" , "start" ]
You can’t perform that action at this time.
0 commit comments