Skip to content

Commit

Permalink
Update: 实现了多平台的docker images自动化构建
Browse files Browse the repository at this point in the history
  • Loading branch information
Aicnal committed Nov 4, 2024
1 parent 312b355 commit 971220e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 5 deletions.
49 changes: 44 additions & 5 deletions .github/workflows/composeImage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ services:
## 功能
- [x] 使用GitHub Actions实现了全自动构建Docker Images,兼容了Windows、Linux和macOS
- [x] 当脚本执行的时候不再对已经存在转码过的图片进行处理,会生成一个`processed_files.txt`文件
- [ ] 使用硬件加速

0 comments on commit 971220e

Please sign in to comment.