Skip to content

Commit 73d3956

Browse files
committed
ci: publish workflow
1 parent 7f30c04 commit 73d3956

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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

server/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ WORKDIR /app
33
COPY package*.json ./
44
RUN npm ci
55
COPY . .
6+
RUN npm run build
67
EXPOSE 3000
78
CMD ["npm", "start"]

server/package-lock.json

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)