diff --git a/.github/workflows/composeImage.yml b/.github/workflows/composeImage.yml index 9fd8bbe..95ca402 100644 --- a/.github/workflows/composeImage.yml +++ b/.github/workflows/composeImage.yml @@ -2,8 +2,8 @@ name: 构建镜像并推送到Docker Hub on: push jobs: - docker-build: - name: Docker build工作 + docker-build-linux: + name: Docker build Linux runs-on: ubuntu-latest steps: @@ -13,11 +13,50 @@ jobs: - name: 登陆DockerHub uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{secrets.DOCKER_TOKEN}} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} - name: 构建并且推送到Docker Hub uses: docker/build-push-action@v5 with: push: true - tags: aicnal/image-compressor:latest \ No newline at end of file + tags: aicnal/linux-image-compressor:latest + + docker-build-windows: + name: Docker build Windows + runs-on: windows-latest + + steps: + - name: 读取仓库内容 + uses: actions/checkout@v4 + + - name: 登陆DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + + - name: 构建并且推送到Docker Hub + run: | + docker build -t aicnal/windows-image-compressor:latest . + docker push aicnal/windows-image-compressor:latest + + docker-build-macos: + name: Docker build macOS + runs-on: macos-latest + + steps: + - name: 读取仓库内容 + uses: actions/checkout@v4 + + - name: 登陆DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + + - name: 构建并且推送到Docker Hub + uses: docker/build-push-action@v5 + with: + push: true + tags: aicnal/macos-image-compressor:latest \ No newline at end of file diff --git a/README.md b/README.md index 6336d29..9634248 100644 --- a/README.md +++ b/README.md @@ -45,5 +45,6 @@ services: ## 功能 +- [x] 使用GitHub Actions实现了全自动构建Docker Images,兼容了Windows、Linux和macOS - [x] 当脚本执行的时候不再对已经存在转码过的图片进行处理,会生成一个`processed_files.txt`文件 - [ ] 使用硬件加速 \ No newline at end of file