Skip to content

Commit 31ec9b8

Browse files
authored
Merge b4bb390 into 2218e09
2 parents 2218e09 + b4bb390 commit 31ec9b8

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

.github/workflows/cpp-main.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,19 @@
4343
upload_url: ${{ steps.create_release.outputs.upload_url }}
4444
asset_name: cmake-main-latest
4545
asset_path: ./build/main
46-
asset_content_type: application/octet-stream
46+
asset_content_type: application/octet-stream
47+
48+
- name: Set up Docker Buildx
49+
uses: docker/setup-buildx-action@v2
50+
51+
- name: Log in to Docker Hub #help
52+
uses: docker/login-action@v2
53+
with:
54+
username: ${{ secrets.DOCKER_USERNAME }}
55+
password: ${{ secrets.DOCKER_PASSWORD }}
56+
57+
- name: Build and push Docker image
58+
run: |
59+
docker build -t ${{ secrets.DOCKER_USERNAME }}/cmake-main:latest .
60+
docker push ${{ secrets.DOCKER_USERNAME }}/cmake-main:latest
4761

DockerFile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM ubuntu:latest
2+
3+
RUN apt-get update && apt-get install -y g++ cmake
4+
5+
COPY CMakeLists.txt .
6+
7+
RUN cmake -B build .
8+
RUN cmake --build build --config Release
9+
10+
EXPOSE 8089
11+
12+
CMD ["./build/main"]

compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
services:
2+
cmake-main:
3+
image: cmake-main
4+
build:
5+
context: .
6+
dockerfile: DockerFile
7+
ports:
8+
- "8089:8089"

0 commit comments

Comments
 (0)