From f6688ac0019cce3858b1148119d12a766b32f87c Mon Sep 17 00:00:00 2001 From: fantasy-peak <1356346239@qq.com> Date: Fri, 4 Aug 2023 13:43:07 +0900 Subject: [PATCH] Add dockerfile --- .github/workflows/ubuntu.yaml | 26 ++++++++++++++++++-------- Dockerfile | 14 ++++++++++++++ 2 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 Dockerfile diff --git a/.github/workflows/ubuntu.yaml b/.github/workflows/ubuntu.yaml index 1e1b7de..20759e0 100644 --- a/.github/workflows/ubuntu.yaml +++ b/.github/workflows/ubuntu.yaml @@ -1,6 +1,10 @@ name: Linux -on: [push, pull_request] +on: + push: + branches: [ "main", "dev" ] + pull_request: + branches: [ "main" ] jobs: build: @@ -11,11 +15,6 @@ jobs: os: [ubuntu-22.04] steps: - # - uses: actions/checkout@v1 - # - uses: xmake-io/github-action-setup-xmake@v1 - # with: - # xmake-version: branch@master - # actions-cache-folder: '.xmake-cache' - name: Installation run: | sudo apt-get update @@ -35,5 +34,16 @@ jobs: source ~/.xmake/profile xmake build -y xmake install -o . - cd bin - ldd cpp-freegpt-webui + ldd ./bin/cpp-freegpt-webui + - name: Docker login + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + - name: Build the Docker image + run: | + pwd + ls + docker build . -t ${{ secrets.DOCKERHUB_USERNAME }}/freegpt:latest + - name: Docker image push + run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/freegpt:latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d63d478 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM ubuntu:22.04 + +WORKDIR /app + +ADD bin /app/bin +ADD cfg /app/cfg +ADD client /app/client + +RUN ls /app/bin +RUN ls /app/cfg + +WORKDIR /app/bin + +ENTRYPOINT ["sh", "-c", "./cpp-freegpt-webui ../cfg/cpp-free-gpt.yml"]