Skip to content

Commit

Permalink
add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
charlie-captain committed Apr 2, 2023
1 parent 8f26ac2 commit 43b7990
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 11 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Docker Build and Publish

on:
push:
branches:
- main
workflow_dispatch:

jobs:
build-and-push-image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Build amd64 image
run: docker buildx build --progress=plain --platform linux/amd64 -t charliecaptain/meowai-image:latest -f ./Dockerfile .

- name: Build arm64 image
run: docker buildx build --progress=plain --platform linux/arm64 -t charliecaptain/meowai-image:latest-arm-linux -f ./Dockerfile .

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Push amd64 image
run: docker push charliecaptain/meowai-image:latest

- name: Push arm64 image
run: docker push charliecaptain/meowai-image:latest-arm-linux
11 changes: 0 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,6 @@ COPY . /app
WORKDIR /app

# 安装所需依赖
#RUN apt-get update --fix-missing \
# && apt-get install ffmpeg libsm6 libxext6 -y \
# && pip install --upgrade pip \
# && pip install -r requirements.txt \
# && pip install -r yolov5/requirements.txt \
# && pip install torch==1.13.0 torchvision==0.14.0 --index-url https://download.pytorch.org/whl/cpu \
## && apt-get install -y libgl1-mesa-glx \
# # 删除缓存文件
# && rm -rf /var/lib/apt/lists/* \
# && rm -rf ~/.cache/pip

RUN pip install --upgrade pip \
&& pip install -r requirements.txt \
&& pip install torch==1.13.0 torchvision==0.14.0 --index-url https://download.pytorch.org/whl/cpu \
Expand Down

0 comments on commit 43b7990

Please sign in to comment.