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 a0281b6
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 11 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Docker Build and Publish

on:
push:
branches:
- main
workflow_dispatch:

env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ ubuntu-latest ]
arch: [ amd64, arm64 ]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Login to DockerHub
run: echo "${DOCKERHUB_PASSWORD}" | docker login --username "${DOCKERHUB_USERNAME}" --password-stdin

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Build and push AMD64 image
uses: docker/build-push-action@v2
with:
context: .
push: true
platforms: linux/amd64
tags: ${DOCKERHUB_USERNAME}:latest

- name: Build and push ARM64 image
uses: docker/build-push-action@v2
with:
context: .
push: true
platforms: linux/arm64
tags: ${DOCKERHUB_USERNAME}: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 a0281b6

Please sign in to comment.